com.ibm.websphere.collective.controller
Interface ServerCommandsMBean

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

public interface ServerCommandsMBean
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
static java.lang.String OBJECT_NAME
          A String representing the ObjectName that this MBean maps to.
static java.lang.String OPERATION_RETURN_CODE
          Return code for the operation result map.
static java.lang.String OPERATION_STDERR
          The contents of stderr for the operation result map.
static java.lang.String OPERATION_STDOUT
          The contents of stdout for the operation result map.
static java.lang.String STATUS_NOT_FOUND
          Status value for a server which does not exist.
static java.lang.String STATUS_STARTED
          Status value for a started server.
static java.lang.String STATUS_STOPPED
          Status value of a stopped server.
 
Method Summary
 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.
 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.
 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

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

See Also:
Constant Field Values

OPERATION_RETURN_CODE

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:
Constant Field Values

OPERATION_STDOUT

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:
Constant Field Values

OPERATION_STDERR

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:
Constant Field Values

STATUS_STARTED

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:
Constant Field Values

STATUS_STOPPED

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:
Constant Field Values

STATUS_NOT_FOUND

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:
Constant Field Values
Method Detail

startServer

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)
                                                             throws java.net.ConnectException,
                                                                    java.io.IOException,
                                                                    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

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)
                                                            throws java.net.ConnectException,
                                                                   java.io.IOException,
                                                                   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

java.lang.String getServerStatus(java.lang.String hostName,
                                 java.lang.String wlpUserDir,
                                 java.lang.String serverName)
                                 throws java.io.IOException,
                                        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