Interface ServerCommandsMBean
- All Superinterfaces:
NotificationBroadcaster,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
FieldsModifier and TypeFieldDescriptionstatic final StringA String representing theObjectNamethat this MBean maps to.static final StringReturn code for the operation result map.static final StringThe contents of stderr for the operation result map.static final StringThe contents of stdout for the operation result map.static final StringStatus value for a server which does not exist.static final StringStatus value for a started server.static final StringStatus value for a server which is starting, as initiated from this MBean.static final StringStatus value of a stopped server.static final StringStatus value for a server that is stopping, as initiated by this MBean. -
Method Summary
Modifier and TypeMethodDescriptiongetServerStatus(String hostName, String wlpUserDir, String serverName) Get the status of a registered server collective member.javadumpServer(String hostName, String wlpUserDir, String serverName, String options) Generate a Java dump of a registered server collective member.startServer(String hostName, String wlpUserDir, String serverName, String options) Start a registered server collective member.stopServer(String hostName, String wlpUserDir, String serverName, String options) Stop a registered server collective member.Methods inherited from interface javax.management.NotificationBroadcaster
addNotificationListener, getNotificationInfo, removeNotificationListenerMethods inherited from interface javax.management.NotificationEmitter
removeNotificationListener
-
Field Details
-
OBJECT_NAME
A String representing theObjectNamethat this MBean maps to.- See Also:
-
OPERATION_RETURN_CODE
Return code for the operation result map.This is the return code reported by the operation.
- See Also:
-
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
The contents of stderr for the operation result map.This is the contents of standard error stream for the operation.
- See Also:
-
STATUS_STARTED
Status value for a started server.This is equivalent to a status return code of 0.
- See Also:
-
STATUS_STARTING
Status value for a server which is starting, as initiated from this MBean.Returned by the getStatus() method.
- See Also:
-
STATUS_STOPPING
Status value for a server that is stopping, as initiated by this MBean.Returned by the getStatus() method.
- See Also:
-
STATUS_STOPPED
Status value of a stopped server.This is equivalent to a status return code of 1.
- See Also:
-
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 benullor 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 benullor an empty string. Must not have a trailing slash. Must not be encoded.serverName- The server name. If serverName isnull, the defaultServer is assumed. Must not be an empty string.options- Options supported by the wlp/bin/server script "start" action. May benullor 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 benullor 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 benullor 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 benullor 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 benullor 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 benullor an empty string. Must not have a trailing slash. Must not be encoded.serverName- The server name. If serverName isnull, 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 repositoryIllegalArgumentException- 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 benullor 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 benullor an empty string. Must not have a trailing slash. Must not be encoded.serverName- The server name. If serverName isnull, the defaultServer is assumed. Must not be an empty string.options- Options supported by the wlp/bin/server script "javadump" action. May benullor 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
-