com.ibm.websphere.collective.controller

Interface ServerCommandsMBean

All Superinterfaces:
javax.management.NotificationBroadcaster, javax.management.NotificationEmitter

  1. public interface ServerCommandsMBean
  2. extends javax.management.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 Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
OBJECT_NAME
A String representing the ObjectName that this MBean maps to.
  1. static
  2. java.lang.String
OPERATION_RETURN_CODE
Return code for the operation result map.
  1. static
  2. java.lang.String
OPERATION_STDERR
The contents of stderr for the operation result map.
  1. static
  2. java.lang.String
OPERATION_STDOUT
The contents of stdout for the operation result map.
  1. static
  2. java.lang.String
STATUS_NOT_FOUND
Status value for a server which does not exist.
  1. static
  2. java.lang.String
STATUS_STARTED
Status value for a started server.
  1. static
  2. java.lang.String
STATUS_STOPPED
Status value of a stopped server.

Method Summary

Modifier and Type Method and Description
  1. java.lang.String
getServerStatus(java.lang.String hostName,java.lang.String wlpUserDir,java.lang.String serverName)
Get the status of a registered server collective member.
  1. java.util.Map<java.lang.String,java.lang.Object>
startServer(java.lang.String hostName,java.lang.String wlpUserDir,java.lang.String serverName,java.lang.String options)
Start a registered server collective member.
  1. java.util.Map<java.lang.String,java.lang.Object>
stopServer(java.lang.String hostName,java.lang.String wlpUserDir,java.lang.String serverName,java.lang.String options)
Stop a registered server collective member.
Methods inherited from interface javax.management.NotificationEmitter
removeNotificationListener
Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListener

Field Detail

OBJECT_NAME

  1. static final java.lang.String OBJECT_NAME
A String representing the ObjectName that this MBean maps to.
See Also:

OPERATION_RETURN_CODE

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

This is the return code reported by the operation.

See Also:

OPERATION_STDOUT

  1. static final java.lang.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

  1. static final java.lang.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

  1. static final java.lang.String STATUS_STARTED
Status value for a started server.

This is equivalent to a status return code of 0.

See Also:

STATUS_STOPPED

  1. static final java.lang.String STATUS_STOPPED
Status value of a stopped server.

This is equivalent to a status return code of 1.

See Also:

STATUS_NOT_FOUND

  1. static final java.lang.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 Detail

startServer

  1. java.util.Map<java.lang.String,java.lang.Object> startServer( java.lang.String hostName,
  2. java.lang.String wlpUserDir,
  3. java.lang.String serverName,
  4. java.lang.String options)
  5. throws java.net.ConnectException
  6. java.io.IOException
  7. java.lang.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:
java.net.ConnectException - Signals there are problems connecting to the target machine.
java.io.IOException - Signals there are problems during the remote operation.
java.lang.IllegalArgumentException - If an input parameter has a value that is not valid

stopServer

  1. java.util.Map<java.lang.String,java.lang.Object> stopServer( java.lang.String hostName,
  2. java.lang.String wlpUserDir,
  3. java.lang.String serverName,
  4. java.lang.String options)
  5. throws java.net.ConnectException
  6. java.io.IOException
  7. java.lang.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:
java.net.ConnectException - Signals there are problems connecting to the target machine.
java.io.IOException - Signals there are problems during the remote operation.
java.lang.IllegalArgumentException - If an input parameter has a value that is not valid

getServerStatus

  1. java.lang.String getServerStatus( java.lang.String hostName,
  2. java.lang.String wlpUserDir,
  3. java.lang.String serverName)
  4. throws java.io.IOException
  5. java.lang.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:
java.io.IOException - If there is a problem accessing the collective repository
java.lang.IllegalArgumentException - If an input parameter has a value that is not valid