public class ClusterDAO extends Object
Constructor and Description |
---|
ClusterDAO() |
Modifier and Type | Method and Description |
---|---|
void |
create(ClusterEntity clusterEntity)
Create Cluster entity in Database
|
void |
createConfig(ClusterConfigEntity entity)
Creates a cluster configuration in the DB.
|
List<ClusterEntity> |
findAll() |
ClusterEntity |
findById(long id)
Looks for Cluster by ID
|
ClusterEntity |
findByName(String clusterName) |
ClusterEntity |
findByResourceId(long resourceId) |
ClusterConfigEntity |
findConfig(Long configEntityPK) |
ClusterConfigEntity |
findConfig(Long clusterId,
String type,
Long version) |
ClusterConfigEntity |
findConfig(Long clusterId,
String type,
String tag) |
ClusterConfigEntity |
findEnabledConfigByType(long clusterId,
String type)
Gets the latest config in the given cluster by type name.
|
Long |
findNextConfigVersion(long clusterId,
String configType)
Gets the next version that will be created for a given
ClusterConfigEntity . |
List<ClusterConfigEntity> |
getAllConfigurations(Long clusterId,
StackId stackId)
Get all configurations for the specified cluster and stack.
|
List<ClusterConfigEntity> |
getEnabledConfigs(long clusterId)
Gets the latest configurations for the specified cluster.
|
List<ClusterConfigEntity> |
getEnabledConfigsByStack(long clusterId,
StackId stackId)
Gets the latest configurations for a given stack for all of the
configurations of the specified cluster.
|
List<ClusterConfigEntity> |
getEnabledConfigsByTypes(Long clusterId,
Collection<String> types) |
List<ClusterConfigEntity> |
getLatestConfigurations(long clusterId,
StackId stackId)
Gets the latest configurations for a given stack for all of the
configurations of the specified cluster.
|
List<ClusterConfigEntity> |
getLatestConfigurationsWithTypes(long clusterId,
StackId stackId,
Collection<String> configTypes)
Gets the latest configurations for a given stack with any of the given config types.
|
boolean |
isManaged(ClusterEntity entity) |
ClusterConfigEntity |
merge(ClusterConfigEntity clusterConfigEntity)
Merge the specified entity into the current persistence context.
|
ClusterConfigEntity |
merge(ClusterConfigEntity clusterConfigEntity,
boolean flush)
Merge the specified entity into the current persistence context.
|
ClusterEntity |
merge(ClusterEntity clusterEntity)
Merge the specified entity into the current persistence context.
|
ClusterEntity |
merge(ClusterEntity clusterEntity,
boolean flush)
Merge the specified entity into the current persistence context, optionally
instructing the
EntityManager to write any queued persist/merges
into the database immediately. |
void |
refresh(ClusterEntity clusterEntity)
Retrieve entity data from DB
|
void |
remove(ClusterEntity clusterEntity) |
void |
removeByName(String clusterName) |
void |
removeByPK(long id) |
void |
removeConfig(ClusterConfigEntity entity)
Remove a cluster configuration in the DB.
|
public ClusterEntity findById(long id)
id
- ID of Clusterpublic ClusterEntity findByName(String clusterName)
public ClusterEntity findByResourceId(long resourceId)
public List<ClusterEntity> findAll()
public ClusterConfigEntity findConfig(Long configEntityPK)
public ClusterConfigEntity findConfig(Long clusterId, String type, String tag)
public List<ClusterConfigEntity> getEnabledConfigsByTypes(Long clusterId, Collection<String> types)
public ClusterConfigEntity findConfig(Long clusterId, String type, Long version)
public Long findNextConfigVersion(long clusterId, String configType)
ClusterConfigEntity
.clusterId
- the cluster that the service is a part of.configType
- the name of the configuration type (not null
).public List<ClusterConfigEntity> getAllConfigurations(Long clusterId, StackId stackId)
clusterId
- the cluster (not null
).stackId
- the stack (not null
).public List<ClusterConfigEntity> getLatestConfigurations(long clusterId, StackId stackId)
clusterId
- the cluster that the service is a part of.stackId
- the stack to get the latest configurations for (not null
).public List<ClusterConfigEntity> getLatestConfigurationsWithTypes(long clusterId, StackId stackId, Collection<String> configTypes)
public List<ClusterConfigEntity> getEnabledConfigsByStack(long clusterId, StackId stackId)
clusterId
- the cluster that the service is a part of.stackId
- the stack to get the latest configurations for (not null
).public List<ClusterConfigEntity> getEnabledConfigs(long clusterId)
clusterId
- the cluster that the service is a part of.public ClusterConfigEntity findEnabledConfigByType(long clusterId, String type)
clusterId
- the ID of the cluster.type
- the config type (not null
).null
if there is none enabled.public void create(ClusterEntity clusterEntity)
clusterEntity
- entity to createpublic void createConfig(ClusterConfigEntity entity)
public void removeConfig(ClusterConfigEntity entity)
public void refresh(ClusterEntity clusterEntity)
clusterEntity
- entity to refreshpublic ClusterEntity merge(ClusterEntity clusterEntity)
clusterEntity
- the entity to merge (not null
).null
).public ClusterEntity merge(ClusterEntity clusterEntity, boolean flush)
EntityManager
to write any queued persist/merges
into the database immediately.clusterEntity
- the entity to merge (not null
).flush
- if true
then EntityManager.flush()
will be invoked
immediately after the merge.null
).public ClusterConfigEntity merge(ClusterConfigEntity clusterConfigEntity)
clusterConfigEntity
- the entity to merge (not null
).null
).public ClusterConfigEntity merge(ClusterConfigEntity clusterConfigEntity, boolean flush)
clusterConfigEntity
- the entity to merge (not null
).flush
- if true
then EntityManager.flush()
will be invoked
immediately after the merge.null
).public void remove(ClusterEntity clusterEntity)
public void removeByName(String clusterName)
public void removeByPK(long id)
public boolean isManaged(ClusterEntity entity)
Copyright © 2022 Apache Software Foundation. All rights reserved.