public interface ServerCommandsMBean
extends javax.management.NotificationEmitter
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.
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 |
Modifier and Type | Field and Description |
---|---|
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_STARTING
Status value for a server which is starting, as initiated from this MBean.
|
static java.lang.String |
STATUS_STOPPED
Status value of a stopped server.
|
static java.lang.String |
STATUS_STOPPING
Status value for a server that is stopping, as initiated by this MBean.
|
Modifier and Type | Method and Description |
---|---|
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> |
javadumpServer(java.lang.String hostName,
java.lang.String wlpUserDir,
java.lang.String serverName,
java.lang.String options)
Generate a Java dump of the current process.
|
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.
|
static final java.lang.String OBJECT_NAME
ObjectName
that this MBean maps to.static final java.lang.String OPERATION_RETURN_CODE
This is the return code reported by the operation.
static final java.lang.String OPERATION_STDOUT
This is the contents of standard output stream for the operation.
static final java.lang.String OPERATION_STDERR
This is the contents of standard error stream for the operation.
static final java.lang.String STATUS_STARTED
This is equivalent to a status return code of 0.
static final java.lang.String STATUS_STARTING
Returned by the getStatus() method.
static final java.lang.String STATUS_STOPPING
Returned by the getStatus() method.
static final java.lang.String STATUS_STOPPED
This is equivalent to a status return code of 1.
static final java.lang.String STATUS_NOT_FOUND
This is equivalent to a status return code of 2.
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
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.xmlwlpUserDir
- 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.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 validjava.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
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.xmlwlpUserDir
- 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.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 validjava.lang.String getServerStatus(java.lang.String hostName, java.lang.String wlpUserDir, java.lang.String serverName) throws java.io.IOException, java.lang.IllegalArgumentException
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.xmlwlpUserDir
- 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.java.io.IOException
- If there is a problem accessing the collective repositoryjava.lang.IllegalArgumentException
- If an input parameter has a value that is not validjava.util.Map<java.lang.String,java.lang.Object> javadumpServer(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
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.xmlwlpUserDir
- 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.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