Interface ClusterManagerMBean
-
public interface ClusterManagerMBean
The ClusterManagerMBean defines the management interface for clusters.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".
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
OBJECT_NAME
A String representing theObjectName
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.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
OBJECT_NAME
static final java.lang.String OBJECT_NAME
A String representing theObjectName
that this MBean maps to.- See Also:
- Constant Field Values
-
OPERATION_EXCEPTION
static final java.lang.String OPERATION_EXCEPTION
Exception key for the operation result map.The Exception object thrown by the operation.
- See Also:
- Constant Field Values
-
OPERATION_EXCEPTION_MESSAGE
static final java.lang.String OPERATION_EXCEPTION_MESSAGE
Exception message key for the operation result map.The value of the Exception message thrown by the operation.
- See Also:
- Constant Field Values
-
STATUS_STARTED
static final java.lang.String STATUS_STARTED
Status value for a fully started cluster (all members are started).Returned by the getStatus() method.
- See Also:
- Constant Field Values
-
STATUS_STARTING
static final java.lang.String STATUS_STARTING
Status value for a cluster which is starting, as initiated from this MBean.Returned by the getStatus() method.
- See Also:
- Constant Field Values
-
STATUS_PARTIALLY_STARTED
static final java.lang.String STATUS_PARTIALLY_STARTED
Status value for a partially started cluster (some members are started).Returned by the getStatus() method.
- See Also:
- Constant Field Values
-
STATUS_STOPPING
static final java.lang.String STATUS_STOPPING
Status value for a cluster that is stopping, as initiated by this MBean.Returned by the getStatus() method.
- See Also:
- Constant Field Values
-
STATUS_NOT_STARTED
static final java.lang.String STATUS_NOT_STARTED
Status value for a fully stopped cluster (no members are started).Returned by the getStatus() method.
- See Also:
- Constant Field Values
-
-
Method Detail
-
listClusterNames
java.util.Collection<java.lang.String> listClusterNames()
Get a list of all cluster names known by this collective controller.- Returns:
- A list of all cluster names known by this collectiveController.
null
is not returned.
-
listMembers
java.util.Collection<java.lang.String> listMembers(java.lang.String clusterName) throws java.lang.IllegalArgumentException
Get a list of the server tuples which are members of the specified cluster.A server tuple is defined as (hostName,wlpUserDir,serverName). See
RepositoryPathUtilityMBean
for more on a server tuples.- Parameters:
clusterName
- The name of the cluster for which the member list will be generated. Must not benull
or an empty String.- Returns:
- A list of the server tuples which are members of the specified cluster,
or
null
if no such cluster exists with that name. - Throws:
java.lang.IllegalArgumentException
- If the clusterName isnull
or empty.
-
getStatus
java.lang.String getStatus(java.lang.String clusterName) throws java.lang.IllegalArgumentException
Get the status of the cluster as reported by the collective controller. The status can be one of:- "STARTED", indicating all cluster members are started
- "PARTIALLY STARTED", indicating some cluster members are started
- "NOT STARTED", indicating no cluster members are started
- Parameters:
clusterName
- The name of the cluster for which the status will be obtained. Must not benull
or an empty String.- Returns:
- The status of the cluster. One of "STARTED", "PARTIALLY STARTED",
or "NOT STARTED" will be returned. If the cluster does not
exist,
null
is returned. - Throws:
java.lang.IllegalArgumentException
- If the clusterName isnull
or empty
-
getClusterName
java.lang.String getClusterName(java.lang.String hostName, java.lang.String wlpUserDir, java.lang.String serverName) throws java.lang.IllegalArgumentException
Get the name of the cluster that the specified server belongs to.- Parameters:
hostName
- The host name of the server. Must not benull
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 benull
or an empty string. Must not have a trailing slash. Must not be encoded.serverName
- The server name. Must not benull
or an empty string.- Returns:
- The name of the cluster which the specified server belongs to, or
null
if the specified server does not belong to a cluster. - Throws:
java.lang.IllegalArgumentException
- Thrown if any supplied parameter is null or empty, or if the specified server is not known to the collective controller.
-
startCluster
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
Start all of the servers in the specified cluster.- Parameters:
clusterName
- The name of the cluster which should be started. Must not benull
or an empty String.options
- Options supported by the wlp/bin/server script "start" action. May benull
or an empty string.- Returns:
- A map of cluster member names mapped to the status of the start
operation as reported by the ServerCommandsMBean. If the operation
caused an Exception, the Exception is stored in the map under the
key
OPERATION_EXCEPTION
and the Exception message is stored in the map under keyOPERATION_EXCEPTION_MESSAGE
. - Throws:
java.lang.IllegalArgumentException
- If the clusterName wasnull
, empty, if the cluster is not defined or if the cluster has no members.- See Also:
ServerCommandsMBean
-
stopCluster
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
Stops all of the servers in the specified cluster.- Parameters:
clusterName
- The name of the cluster which should be stopped. Must not benull
or an empty String.options
- Options supported by the wlp/bin/server script "stop" action. May benull
or an empty string.- Returns:
- A map of cluster member names mapped to the status of the stop operation,
as reported by the ServerCommandsMBean. If the operation
caused an Exception, the Exception is stored in the map under the
key
OPERATION_EXCEPTION
and the Exception message is stored in the map under keyOPERATION_EXCEPTION_MESSAGE
. - Throws:
java.lang.IllegalArgumentException
- If the clusterName wasnull
, empty, if the cluster is not defined or if the cluster has no members.- See Also:
ServerCommandsMBean
-
generateClusterPluginConfig
java.lang.String generateClusterPluginConfig(java.lang.String clusterName) throws java.lang.IllegalArgumentException
Merges web server plugin-cfg.xml files from cluster members in a given cluster. This operation only merges plugins files from started cluster members.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.- Parameters:
clusterName
- The name of the cluster. Must not benull
or an empty String.- Returns:
- The path to the merged plugin-cfg.xml on collective controller.
- Throws:
java.lang.IllegalArgumentException
- If the clusterName wasnull
, empty, if the cluster is not defined or if the cluster has no members.
-
-