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".
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA String representing theObjectNamethat this MBean maps to.static final StringException key for the operation result map.static final StringException message key for the operation result map.static final StringStatus value for a fully stopped cluster (no members are started).static final StringStatus value for a partially started cluster (some members are started).static final StringStatus value for a fully started cluster (all members are started).static final StringStatus value for a cluster which is starting, as initiated from this MBean.static final StringStatus value for a cluster that is stopping, as initiated by this MBean. -
Method Summary
Modifier and TypeMethodDescriptiongenerateClusterPluginConfig(String clusterName) Merges web server plugin-cfg.xml files from cluster members in a given cluster.getClusterName(String hostName, String wlpUserDir, String serverName) Get the name of the cluster that the specified server belongs to.Get the status of the cluster as reported by the collective controller.Get a list of all cluster names known by this collective controller.listMembers(String clusterName) Get a list of the server tuples which are members of the specified cluster.startCluster(String clusterName, String options) Start all of the servers in the specified cluster.stopCluster(String clusterName, String options) Stops all of the servers in the specified cluster.
-
Field Details
-
OBJECT_NAME
A String representing theObjectNamethat this MBean maps to.- See Also:
-
OPERATION_EXCEPTION
Exception key for the operation result map.The Exception object thrown by the operation.
- See Also:
-
OPERATION_EXCEPTION_MESSAGE
Exception message key for the operation result map.The value of the Exception message thrown by the operation.
- See Also:
-
STATUS_STARTED
Status value for a fully started cluster (all members are started).Returned by the getStatus() method.
- See Also:
-
STATUS_STARTING
Status value for a cluster which is starting, as initiated from this MBean.Returned by the getStatus() method.
- See Also:
-
STATUS_PARTIALLY_STARTED
Status value for a partially started cluster (some members are started).Returned by the getStatus() method.
- See Also:
-
STATUS_STOPPING
Status value for a cluster that is stopping, as initiated by this MBean.Returned by the getStatus() method.
- See Also:
-
STATUS_NOT_STARTED
Status value for a fully stopped cluster (no members are started).Returned by the getStatus() method.
- See Also:
-
-
Method Details
-
listClusterNames
Collection<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.
nullis not returned.
-
listMembers
Get a list of the server tuples which are members of the specified cluster.A server tuple is defined as (hostName,wlpUserDir,serverName). See
RepositoryPathUtilityMBeanfor more on a server tuples.- Parameters:
clusterName- The name of the cluster for which the member list will be generated. Must not benullor an empty String.- Returns:
- A list of the server tuples which are members of the specified cluster,
or
nullif no such cluster exists with that name. - Throws:
IllegalArgumentException- If the clusterName isnullor empty.
-
getStatus
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 benullor 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,
nullis returned. - Throws:
IllegalArgumentException- If the clusterName isnullor empty
-
getClusterName
String getClusterName(String hostName, String wlpUserDir, String serverName) throws IllegalArgumentException Get the name of the cluster that the specified server belongs to.- Parameters:
hostName- The host name of the server. Must not benullor 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 benullor an empty string. Must not have a trailing slash. Must not be encoded.serverName- The server name. Must not benullor an empty string.- Returns:
- The name of the cluster which the specified server belongs to, or
nullif the specified server does not belong to a cluster. - Throws:
IllegalArgumentException- Thrown if any supplied parameter is null or empty, or if the specified server is not known to the collective controller.
-
startCluster
Map<String,Map<String, startClusterObject>> (String clusterName, String options) throws IllegalArgumentException Start all of the servers in the specified cluster.- Parameters:
clusterName- The name of the cluster which should be started. Must not benullor an empty String.options- Options supported by the wlp/bin/server script "start" action. May benullor 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_EXCEPTIONand the Exception message is stored in the map under keyOPERATION_EXCEPTION_MESSAGE. - Throws:
IllegalArgumentException- If the clusterName wasnull, empty, if the cluster is not defined or if the cluster has no members.- See Also:
-
stopCluster
Map<String,Map<String, stopClusterObject>> (String clusterName, String options) throws IllegalArgumentException Stops all of the servers in the specified cluster.- Parameters:
clusterName- The name of the cluster which should be stopped. Must not benullor an empty String.options- Options supported by the wlp/bin/server script "stop" action. May benullor 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_EXCEPTIONand the Exception message is stored in the map under keyOPERATION_EXCEPTION_MESSAGE. - Throws:
IllegalArgumentException- If the clusterName wasnull, empty, if the cluster is not defined or if the cluster has no members.- See Also:
-
generateClusterPluginConfig
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 benullor an empty String.- Returns:
- The path to the merged plugin-cfg.xml on collective controller.
- Throws:
IllegalArgumentException- If the clusterName wasnull, empty, if the cluster is not defined or if the cluster has no members.
-