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 Details

    • OBJECT_NAME

      static final String OBJECT_NAME
      A String representing the ObjectName that this MBean maps to.
      See Also:
    • OPERATION_EXCEPTION

      static final String OPERATION_EXCEPTION
      Exception key for the operation result map.

      The Exception object thrown by the operation.

      See Also:
    • OPERATION_EXCEPTION_MESSAGE

      static final String 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

      static final String STATUS_STARTED
      Status value for a fully started cluster (all members are started).

      Returned by the getStatus() method.

      See Also:
    • STATUS_STARTING

      static final String 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

      static final String STATUS_PARTIALLY_STARTED
      Status value for a partially started cluster (some members are started).

      Returned by the getStatus() method.

      See Also:
    • STATUS_STOPPING

      static final String 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

      static final String 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. null is not returned.
    • listMembers

      Collection<String> listMembers(String clusterName) throws 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 be null 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:
      IllegalArgumentException - If the clusterName is null or empty.
    • getStatus

      String getStatus(String clusterName) throws IllegalArgumentException
      Get the status of the cluster as reported by the collective controller. The status can be one of:
      Parameters:
      clusterName - The name of the cluster for which the status will be obtained. Must not be null 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:
      IllegalArgumentException - If the clusterName is null or 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 be null or an empty string. This host name should match the host name set to the defaultHostName variable for the server's server.xml
      wlpUserDir - 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.
      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:
      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,Object>> startCluster(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 be null or an empty String.
      options - Options supported by the wlp/bin/server script "start" action. May be null 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 key OPERATION_EXCEPTION_MESSAGE.
      Throws:
      IllegalArgumentException - If the clusterName was null, empty, if the cluster is not defined or if the cluster has no members.
      See Also:
    • stopCluster

      Map<String,Map<String,Object>> stopCluster(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 be null or an empty String.
      options - Options supported by the wlp/bin/server script "stop" action. May be null 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 key OPERATION_EXCEPTION_MESSAGE.
      Throws:
      IllegalArgumentException - If the clusterName was null, empty, if the cluster is not defined or if the cluster has no members.
      See Also:
    • generateClusterPluginConfig

      String generateClusterPluginConfig(String clusterName) throws 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 be null or an empty String.
      Returns:
      The path to the merged plugin-cfg.xml on collective controller.
      Throws:
      IllegalArgumentException - If the clusterName was null, empty, if the cluster is not defined or if the cluster has no members.