public abstract class ParentComponent<T extends Instance> extends Object implements Serializable
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,ClusterDataHolder> |
aliasToClusterDataMap |
protected Map<String,Group> |
aliasToGroupMap |
| Constructor and Description |
|---|
ParentComponent() |
| Modifier and Type | Method and Description |
|---|---|
void |
addGroup(Group group)
Adds a group
|
void |
addInstance(String instanceId,
T instance)
Adds InstanceContext of a child to the instanceIdToInstanceContextMap.
|
boolean |
containsInstanceContext(String instanceId)
Adds InstanceContext of a child to the instanceIdToInstanceContextMap.
|
Map<String,String> |
getAliasToDeploymentPolicyIdMap() |
Map<String,Group> |
getAliasToGroupMap()
Getter for alias to Group map
Will not search recursively in the nested levels.
|
Set<Group> |
getAllGroupsRecursively()
Collects the Group for the parent component and all the
child components recursively
|
protected void |
getClusterData(Set<ClusterDataHolder> clusterData,
Collection<Group> groups) |
ClusterDataHolder |
getClusterData(String alias)
Getter for Cluster Data instance for the given alias
Will not search recursively in the nested levels.
|
Map<String,ClusterDataHolder> |
getClusterDataForAlias() |
Map<String,ClusterDataHolder> |
getClusterDataForType() |
ClusterDataHolder |
getClusterDataHolderRecursivelyByAlias(String alias)
This will recursively search for the cluster data holder in the application by the alias.
|
Map<String,ClusterDataHolder> |
getClusterDataMap()
Getter for cluster alias to ClusterData map for this level
|
Set<ClusterDataHolder> |
getClusterDataRecursively()
Collects the Cluster Data for the parent component and all the
child components recursively
|
int |
getComponentsCount() |
DependencyOrder |
getDependencyOrder()
Getter for Dependency Order for this level
|
String |
getDeploymentPolicy() |
Group |
getGroup(String groupAlias)
Get the Group for the given alias in the context of the parent entity.
|
Group |
getGroupRecursively(String groupAlias)
Get the Group for the given alias in the context of the parent entity.
|
Collection<Group> |
getGroups()
Collection of Groups in this level
|
protected void |
getGroupsRecursively(Set<Group> groupsSet,
Collection<Group> groups) |
int |
getInstanceContextCount()
Retrieves the current number of instance contexts which are kept track in this node
|
T |
getInstanceContexts(String instanceId)
Retrieves InstanceContext obj.
|
List<Instance> |
getInstanceContextsWithParentId(String parentInstanceId)
Retrieves InstanceContext obj.
|
Map<String,T> |
getInstanceIdToInstanceContextMap() |
String |
getNextInstanceId(String alias) |
abstract String |
getUniqueIdentifier()
This method should be implemented in each concrete child class
to return the unique identifier for each implementation
ex.: group alias for a Group, app id for an Application
|
boolean |
isGroupInstanceMonitoringEnabled() |
boolean |
isGroupScalingEnabled() |
void |
removeInstance(String instanceId)
This will remove the instance from instanceIdToInstanceContextMap
|
void |
setAliasToDeploymentPolicyIdMap(Map<String,String> aliasToDeploymentPolicyIdMap) |
void |
setClusterData(Map<String,ClusterDataHolder> aliasToClusterData)
Setter for alias to Cluster Data map
|
void |
setClusterDataForType(Map<String,ClusterDataHolder> typeToClusterData)
Setter for alias to Cluster Data map
|
void |
setDependencyOrder(DependencyOrder dependencyOrder)
Setter for Dependency Order
|
void |
setDeploymentPolicy(String deploymentPolicy) |
void |
setGroupInstanceMonitoringEnabled(boolean isGroupInstanceMonitoringEnabled) |
void |
setGroups(Map<String,Group> groupAliasToGroup)
Setter for Group alias to Group map
|
void |
setGroupScalingEnabled(boolean isGroupScalingEnabled) |
void |
setInstanceIdToInstanceContextMap(Map<String,T> instanceIdToInstanceContextMap) |
protected final Map<String,ClusterDataHolder> aliasToClusterDataMap
public abstract String getUniqueIdentifier()
public void addGroup(Group group)
group - Group instance to be addedpublic Group getGroup(String groupAlias)
groupAlias - alias of the Grouppublic Group getGroupRecursively(String groupAlias)
groupAlias - alias of the Grouppublic ClusterDataHolder getClusterDataHolderRecursivelyByAlias(String alias)
alias - the alias of the clusterpublic Map<String,Group> getAliasToGroupMap()
public Map<String,ClusterDataHolder> getClusterDataMap()
public Collection<Group> getGroups()
public void setGroups(Map<String,Group> groupAliasToGroup)
groupAliasToGroup - Map, key = alias given to the Group, value = Grouppublic DependencyOrder getDependencyOrder()
public void setDependencyOrder(DependencyOrder dependencyOrder)
dependencyOrder - Dependency Order objectpublic void setClusterData(Map<String,ClusterDataHolder> aliasToClusterData)
aliasToClusterData - Map, key = alias given to the cluster, value = ClusterData objectpublic ClusterDataHolder getClusterData(String alias)
alias - public Set<ClusterDataHolder> getClusterDataRecursively()
public Set<Group> getAllGroupsRecursively()
public void addInstance(String instanceId, T instance)
instanceId - instance id of childinstance - InstanceContext objectpublic void removeInstance(String instanceId)
instanceId - instance id of childpublic boolean containsInstanceContext(String instanceId)
instanceId - instance id of childpublic T getInstanceContexts(String instanceId)
instanceId - instance idpublic List<Instance> getInstanceContextsWithParentId(String parentInstanceId)
parentInstanceId - parent instance idpublic int getInstanceContextCount()
public int getComponentsCount()
protected void getClusterData(Set<ClusterDataHolder> clusterData, Collection<Group> groups)
protected void getGroupsRecursively(Set<Group> groupsSet, Collection<Group> groups)
public boolean isGroupScalingEnabled()
public void setGroupScalingEnabled(boolean isGroupScalingEnabled)
public boolean isGroupInstanceMonitoringEnabled()
public void setGroupInstanceMonitoringEnabled(boolean isGroupInstanceMonitoringEnabled)
public String getDeploymentPolicy()
public void setDeploymentPolicy(String deploymentPolicy)
public void setInstanceIdToInstanceContextMap(Map<String,T> instanceIdToInstanceContextMap)
public Map<String,ClusterDataHolder> getClusterDataForType()
public Map<String,ClusterDataHolder> getClusterDataForAlias()
public void setClusterDataForType(Map<String,ClusterDataHolder> typeToClusterData)
typeToClusterData - Map, key = alias given to the cluster, value = ClusterData objectCopyright © 2012–2016 The Apache Software Foundation. All rights reserved.