Interface ServerCommandsMBean

All Superinterfaces:
NotificationBroadcaster, NotificationEmitter

public interface ServerCommandsMBean extends NotificationEmitter
The ServerCommandsMBean defines the management interface for servers within a collective.

The ServerCommands MBean provides operations to start and stop servers in a collective. It can also be used to get the status of a server.

The ObjectName for this MBean is "WebSphere:feature=collectiveController,type=ServerCommands,name=ServerCommands".

All operations performed return a Map of the results.

Operation Result Map

Property Name Description Data Type / Format
"returnCode" The exit code / return code from the execution of the operation Integer
"stdout" The standard output (stdout) from the execution of the operation String
"stderr" The standard error (stderr) from the execution of the operation String
  • Field Details

    • OBJECT_NAME

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

      static final String OPERATION_RETURN_CODE
      Return code for the operation result map.

      This is the return code reported by the operation.

      See Also:
    • OPERATION_STDOUT

      static final String OPERATION_STDOUT
      The contents of stdout for the operation result map.

      This is the contents of standard output stream for the operation.

      See Also:
    • OPERATION_STDERR

      static final String OPERATION_STDERR
      The contents of stderr for the operation result map.

      This is the contents of standard error stream for the operation.

      See Also:
    • STATUS_STARTED

      static final String STATUS_STARTED
      Status value for a started server.

      This is equivalent to a status return code of 0.

      See Also:
    • STATUS_STARTING

      static final String STATUS_STARTING
      Status value for a server which is starting, as initiated from this MBean.

      Returned by the getStatus() method.

      See Also:
    • STATUS_STOPPING

      static final String STATUS_STOPPING
      Status value for a server that is stopping, as initiated by this MBean.

      Returned by the getStatus() method.

      See Also:
    • STATUS_STOPPED

      static final String STATUS_STOPPED
      Status value of a stopped server.

      This is equivalent to a status return code of 1.

      See Also:
    • STATUS_NOT_FOUND

      static final String STATUS_NOT_FOUND
      Status value for a server which does not exist.

      This is equivalent to a status return code of 2.

      See Also:
  • Method Details

    • startServer

      Map<String,Object> startServer(String hostName, String wlpUserDir, String serverName, String options) throws ConnectException, IOException, IllegalArgumentException
      Start a registered server collective member.
      Parameters:
      hostName - The host name on which the target server resides. 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. If serverName is null, the defaultServer is assumed. Must not be an empty string.
      options - Options supported by the wlp/bin/server script "start" action. May be null or an empty string.
      Returns:
      An Operation Result Map.
      Throws:
      ConnectException - Signals there are problems connecting to the target machine.
      IOException - Signals there are problems during the remote operation.
      IllegalArgumentException - If an input parameter has a value that is not valid
    • stopServer

      Map<String,Object> stopServer(String hostName, String wlpUserDir, String serverName, String options) throws ConnectException, IOException, IllegalArgumentException
      Stop a registered server collective member.
      Parameters:
      hostName - The host name on which the target server resides. 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 name of the server to be stopped. If serverName is null, defaultServer will be used.
      options - Options supported by the wlp/bin/server script "stop" action. May be null or an empty string.
      Returns:
      An Operation Result Map.
      Throws:
      ConnectException - Signals there are problems connecting to the target machine.
      IOException - Signals there are problems during the remote operation.
      IllegalArgumentException - If an input parameter has a value that is not valid
    • getServerStatus

      String getServerStatus(String hostName, String wlpUserDir, String serverName) throws IOException, IllegalArgumentException
      Get the status of a registered server collective member.
      Parameters:
      hostName - The host name on which the target server resides. 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. If serverName is null, the defaultServer is assumed. Must not be an empty string.
      Returns:
      "STARTED" when the server is started, "STOPPED" when the server is stopped, or "NOT_FOUND" when the server is not found.
      Throws:
      IOException - If there is a problem accessing the collective repository
      IllegalArgumentException - If an input parameter has a value that is not valid
    • javadumpServer

      Map<String,Object> javadumpServer(String hostName, String wlpUserDir, String serverName, String options) throws ConnectException, IOException, IllegalArgumentException
      Generate a Java dump of a registered server collective member.
      Parameters:
      hostName - The host name on which the target server resides. 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. If serverName is null, the defaultServer is assumed. Must not be an empty string.
      options - Options supported by the wlp/bin/server script "javadump" action. May be null or an empty string.
      Returns:
      An Operation Result Map.
      Throws:
      ConnectException - Signals there are problems connecting to the target machine.
      IOException - Signals there are problems during the remote operation.
      IllegalArgumentException - If an input parameter has a value that is not valid