public class ClusterInfo extends Object implements Cloneable, Serializable
ClusterInfoAware
) in order to be informed of their
specific cluster instance deployment.
Note, the cluster information is obtained externally from the application context which means
that this feature need to be supported by specific containers (and is not supported by plain
Spring application context). This means that beans that implement ClusterInfoAware
should
take into account the fact that the cluster info provided might be null.
Naturally, this information can be used by plain Spring application context by constructing this
class using Spring and providing it as a parameter to ClusterInfoBeanPostProcessor
which
is also configured within Spring application context. Note, if the same application context will
later be deployed into a container that provides cluster information, extra caution need to be
taken to resolve clashes. The best solution would be to define the cluster info within a different
Spring xml context, and excluding it when deploying the full context to a cluster info aware
container.
The absence (null
value) of a certain cluster information property means that it
was not set.
Constructor and Description |
---|
ClusterInfo()
Constructs a new cluster info with null values on all the fields
|
ClusterInfo(String schema,
Integer instanceId,
Integer backupId,
Integer numberOfInstances,
Integer numberOfBackups)
Constructs a new Cluster info
|
Modifier and Type | Method and Description |
---|---|
ClusterInfo |
copy() |
Integer |
getBackupId()
Returns the backup id of the specific cluster member.
|
Integer |
getInstanceId()
Returns the instance id of the specific cluster member.
|
String |
getName()
Returns the logical name of the cluster.
|
Integer |
getNumberOfBackups()
Returns the number of backups that each primary instance will have in a cluster.
|
Integer |
getNumberOfInstances()
Returns the number of primary instances that are running within the cluster.
|
int |
getRunningNumber()
Returns a "running" number represented by the cluster info.
|
int |
getRunningNumberOffset1()
Returns a "running" number:
getRunningNumber() + 1. |
String |
getSchema()
Returns the schema the cluster operates under.
|
String |
getSuffix()
Returns a String suffix that can be used to discriminate instances.
|
String |
getUniqueName()
Returns a unique name of the processing unit.
|
ClusterInfo |
setBackupId(Integer backupId)
Sets the backup id of the specific cluster member.
|
ClusterInfo |
setInstanceId(Integer instanceId)
Sets the instance id of the specific cluster member.
|
ClusterInfo |
setName(String name) |
ClusterInfo |
setNumberOfBackups(Integer numberOfBackups)
Sets the number of backups that each primary instance will have in a cluster.
|
ClusterInfo |
setNumberOfInstances(Integer numberOfInstances)
Sets the number of primary instances that are running within the cluster.
|
ClusterInfo |
setSchema(String schema)
Sets the schema the cluster operates under.
|
String |
toString() |
public ClusterInfo()
public ClusterInfo(String schema, Integer instanceId, Integer backupId, Integer numberOfInstances, Integer numberOfBackups)
schema
- The cluster schemainstanceId
- The instance idbackupId
- The backupId (can be null
)numberOfInstances
- Number of instancesnumberOfBackups
- Number Of backups (can be null
)public String getSchema()
null
value which means that it was not set.public ClusterInfo setSchema(String schema)
null
value which means that it was not set.public Integer getInstanceId()
null
value
which means that it was not set and should not be taken into account.public ClusterInfo setInstanceId(Integer instanceId)
null
value which
means that it was not set and should not be taken into account.IllegalArgumentException
- if value not greater than zero.public Integer getBackupId()
null
value
which means that it was not set and should not be taken into account.public ClusterInfo setBackupId(Integer backupId)
null
value which
means that it was not set and should not be taken into account.IllegalArgumentException
- if value not greater than zero.public Integer getNumberOfInstances()
numberOfBackups
. Can have null
value which means that it was not set and should not be taken into account.public ClusterInfo setNumberOfInstances(Integer numberOfInstances)
numberOfBackups
. Can have null
value
which means that it was not set and should not be taken into account.public Integer getNumberOfBackups()
null
value which means that it was not set and should not be taken into
account.public ClusterInfo setNumberOfBackups(Integer numberOfBackups)
null
value which means that it was not set and should not be taken into
account.public String getName()
public ClusterInfo setName(String name)
public int getRunningNumber()
public int getRunningNumberOffset1()
getRunningNumber()
+ 1.public String getSuffix()
public String getUniqueName()
public ClusterInfo copy()
Copyright © GigaSpaces.