public interface ClusterManagerMBean
The ClusterManager MBean provides operations to manage servers at the cluster level. It is used to stop and start a cluster as well as get member, status, and cluster name information. It is also used to generate the web server plugin-cfg.xml.
The ObjectName for this MBean is "WebSphere:feature=collectiveController,type=ClusterManager,name=ClusterManager".
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
OBJECT_NAME
A String representing the
ObjectName that this MBean maps to. |
static java.lang.String |
OPERATION_EXCEPTION
Exception key for the operation result map.
|
static java.lang.String |
OPERATION_EXCEPTION_MESSAGE
Exception message key for the operation result map.
|
static java.lang.String |
STATUS_NOT_STARTED
Status value for a fully stopped cluster (no members are started).
|
static java.lang.String |
STATUS_PARTIALLY_STARTED
Status value for a partially started cluster (some members are started).
|
static java.lang.String |
STATUS_STARTED
Status value for a fully started cluster (all members are started).
|
static java.lang.String |
STATUS_STARTING
Status value for a cluster which is starting, as initiated from this MBean.
|
static java.lang.String |
STATUS_STOPPING
Status value for a cluster that is stopping, as initiated by this MBean.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
generateClusterPluginConfig(java.lang.String clusterName)
Merges web server plugin-cfg.xml files from cluster members in a given
cluster.
|
java.lang.String |
getClusterName(java.lang.String hostName,
java.lang.String wlpUserDir,
java.lang.String serverName)
Get the name of the cluster that the specified server belongs to.
|
java.lang.String |
getStatus(java.lang.String clusterName)
Get the status of the cluster as reported by the collective controller.
|
java.util.Collection<java.lang.String> |
listClusterNames()
Get a list of all cluster names known by this collective controller.
|
java.util.Collection<java.lang.String> |
listMembers(java.lang.String clusterName)
Get a list of the server tuples which are members of the specified cluster.
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> |
startCluster(java.lang.String clusterName,
java.lang.String options)
Start all of the servers in the specified cluster.
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> |
stopCluster(java.lang.String clusterName,
java.lang.String options)
Stops all of the servers in the specified cluster.
|
static final java.lang.String OBJECT_NAME
ObjectName
that this MBean maps to.static final java.lang.String OPERATION_EXCEPTION
The Exception object thrown by the operation.
static final java.lang.String OPERATION_EXCEPTION_MESSAGE
The value of the Exception message thrown by the operation.
static final java.lang.String STATUS_STARTED
Returned by the getStatus() method.
static final java.lang.String STATUS_STARTING
Returned by the getStatus() method.
static final java.lang.String STATUS_PARTIALLY_STARTED
Returned by the getStatus() method.
static final java.lang.String STATUS_STOPPING
Returned by the getStatus() method.
static final java.lang.String STATUS_NOT_STARTED
Returned by the getStatus() method.
java.util.Collection<java.lang.String> listClusterNames()
null
is not returned.java.util.Collection<java.lang.String> listMembers(java.lang.String clusterName) throws java.lang.IllegalArgumentException
A server tuple is defined as (hostName,wlpUserDir,serverName).
See RepositoryPathUtilityMBean
for more on a server tuples.
clusterName
- The name of the cluster for which the member list will be generated.
Must not be null
or an empty String.null
if no such cluster exists with that name.java.lang.IllegalArgumentException
- If the clusterName is null
or empty.java.lang.String getStatus(java.lang.String clusterName) throws java.lang.IllegalArgumentException
clusterName
- The name of the cluster for which the status will be obtained.
Must not be null
or an empty String.null
is returned.java.lang.IllegalArgumentException
- If the clusterName is null
or emptyjava.lang.String getClusterName(java.lang.String hostName, java.lang.String wlpUserDir, java.lang.String serverName) throws java.lang.IllegalArgumentException
hostName
- The host name of the server. Must not be null
or an empty string.
This host name should match the host name set to the defaultHostName
variable for the server's server.xmlwlpUserDir
- The canonical path for the user directory of server.
This should match the WLP_USER_DIR environment variable for the server.
Must not be null
or an empty string. Must not have a trailing slash.
Must not be encoded.serverName
- The server name. Must not be null
or an empty string.null
if the
specified server does not belong to a cluster.java.lang.IllegalArgumentException
- Thrown if any supplied parameter is null or empty,
or if the specified server is not known to the collective controller.java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> startCluster(java.lang.String clusterName, java.lang.String options) throws java.lang.IllegalArgumentException
clusterName
- The name of the cluster which should be started.
Must not be null
or an empty String.options
- Options supported by the wlp/bin/server script "start" action. May be null
or an empty string.OPERATION_EXCEPTION
and the Exception message is
stored in the map under key OPERATION_EXCEPTION_MESSAGE
.java.lang.IllegalArgumentException
- If the clusterName was null
, empty,
if the cluster is not defined or if the cluster has no members.ServerCommandsMBean
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Object>> stopCluster(java.lang.String clusterName, java.lang.String options) throws java.lang.IllegalArgumentException
clusterName
- The name of the cluster which should be stopped.
Must not be null
or an empty String.options
- Options supported by the wlp/bin/server script "stop" action. May be null
or an empty string.OPERATION_EXCEPTION
and the Exception message is
stored in the map under key OPERATION_EXCEPTION_MESSAGE
.java.lang.IllegalArgumentException
- If the clusterName was null
, empty,
if the cluster is not defined or if the cluster has no members.ServerCommandsMBean
java.lang.String generateClusterPluginConfig(java.lang.String clusterName) throws java.lang.IllegalArgumentException
getStatus(String)
operation can be called to
determine whether all members are started in a given cluster.
The merged plugin file is stored in controller's output directory.
The file can be transferred to client using FileTransferMBean.clusterName
- The name of the cluster.
Must not be null
or an empty String.java.lang.IllegalArgumentException
- If the clusterName was null
, empty,
if the cluster is not defined or if the cluster has no members.