public class HostVersionDAO extends CrudDAO<HostVersionEntity,Long>
HostVersionDAO
class manages the HostVersionEntity
instances associated with a host. Each host can have multiple stack versions in RepositoryVersionState.INSTALLED
which are installed, exactly one stack version that is either RepositoryVersionState.CURRENT
or
RepositoryVersionState.INSTALLING
.Constructor and Description |
---|
HostVersionDAO()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
create(HostVersionEntity entity)
Construct a Host Version.
|
List<HostVersionEntity> |
findByCluster(String clusterName)
Retrieve all of the cluster versions for the given cluster name.
|
List<HostVersionEntity> |
findByClusterAndHost(String clusterName,
String hostName)
Retrieve all of the host versions for the given cluster name and host name.
|
List<HostVersionEntity> |
findByClusterAndState(String clusterName,
RepositoryVersionState state)
Retrieve all of the host versions for the given cluster name, and state.
|
List<HostVersionEntity> |
findByClusterHostAndState(String clusterName,
String hostName,
RepositoryVersionState state)
Retrieve all of the host versions for the given cluster name, host name, and state.
|
List<HostVersionEntity> |
findByClusterStackAndVersion(String clusterName,
StackId stackId,
String version)
Retrieve all of the host versions for the given cluster name, stack name,
and stack version.
|
HostVersionEntity |
findByClusterStackVersionAndHost(String clusterName,
StackId stackId,
String version,
String hostName)
Retrieve the single host version for the given cluster, stack name, stack
version, and host name.
|
List<HostVersionEntity> |
findByHost(String hostName)
Retrieve all of the host versions for the given host name across all clusters.
|
List<HostVersionEntity> |
findByRepositoryAndStates(RepositoryVersionEntity repositoryVersion,
Collection<RepositoryVersionState> states)
Gets all host version entities that are of the given states
|
List<HostVersionEntity> |
findHostVersionByClusterAndRepository(long clusterId,
RepositoryVersionEntity repositoryVersion)
Gets all host version entities assocaited with the specified cluster and
repository.
|
HostVersionEntity |
findHostVersionByHostAndRepository(HostEntity host,
RepositoryVersionEntity repositoryVersion)
Gets the
HostVersionEntity associted with the specified host and
repository. |
void |
removeByHostName(String hostName) |
public void create(HostVersionEntity entity) throws IllegalArgumentException
create
in class CrudDAO<HostVersionEntity,Long>
entity
- entity to createIllegalArgumentException
public List<HostVersionEntity> findByClusterStackAndVersion(String clusterName, StackId stackId, String version)
clusterName
- Cluster namestackId
- Stack (e.g., HDP-2.2)version
- Stack version (e.g., 2.2.0.1-995)public List<HostVersionEntity> findByHost(String hostName)
hostName
- FQDN of hostpublic List<HostVersionEntity> findByClusterAndHost(String clusterName, String hostName)
clusterName
- Cluster namehostName
- FQDN of hostpublic List<HostVersionEntity> findByCluster(String clusterName)
clusterName
- Cluster namepublic List<HostVersionEntity> findByClusterAndState(String clusterName, RepositoryVersionState state)
clusterName
- Cluster namestate
- repository version statepublic List<HostVersionEntity> findByClusterHostAndState(String clusterName, String hostName, RepositoryVersionState state)
clusterName
- Cluster namehostName
- FQDN of hoststate
- repository version statepublic HostVersionEntity findByClusterStackVersionAndHost(String clusterName, StackId stackId, String version, String hostName)
clusterName
- Cluster namestackId
- Stack ID (e.g., HDP-2.2)version
- Stack version (e.g., 2.2.0.1-995)hostName
- FQDN of hostpublic List<HostVersionEntity> findHostVersionByClusterAndRepository(long clusterId, RepositoryVersionEntity repositoryVersion)
clusterId
- the cluster ID.repositoryVersion
- the repository (not null
).public List<HostVersionEntity> findByRepositoryAndStates(RepositoryVersionEntity repositoryVersion, Collection<RepositoryVersionState> states)
repositoryVersion
- the repository (not null
)states
- the statespublic HostVersionEntity findHostVersionByHostAndRepository(HostEntity host, RepositoryVersionEntity repositoryVersion)
HostVersionEntity
associted with the specified host and
repository.host
- repositoryVersion
- public void removeByHostName(String hostName)
Copyright © 2022 Apache Software Foundation. All rights reserved.