com.ibm.websphere.management.cmdframework
Class CommandMgr
- java.lang.Object
com.ibm.websphere.management.cmdframework.CommandMgr
- public abstract class CommandMgr
- extends java.lang.Object
Wherever the term of admin command is referred here, it refers to either a
simple admin command AdminCommand
or a complex admin command,
i.e. a TaskCommand
that includes multiple CommandSteps
Each admin command and command group must have a unique non-localized name for user to identify the command or command group. The concept of command group is introduced to group a set of related commands together so that users can find the related commands easily. A command may belong to multiple command groups if a command may be used in multiple areas. In other words, a command group does not own the commands in the group.
This class provides following areas of functionalities:
- query available admin commands and admin command groups
- query meta data regarding to any admin command.
- create an admin command
- load a serialized admin command
- basic command history functionality
Field Summary
Modifier and Type | Field and Description |
---|---|
|
cmdMgr
|
|
initialized
|
Constructor Summary
Constructor and Description |
---|
CommandMgr()
|
Method Summary
Modifier and Type | Method and Description |
---|---|
|
createCommand(java.lang.String command)
Creates an admin command
|
|
getAdminClient()
Get the AdminClient associate with the most recent ClientCommandMgr called
by
getCommandMgr(AdminClient adminclient) .
|
|
getAllCommandGroupMetadata()
Returns the metadata for a all the command groups.
|
|
getAllCommandMetadata()
|
|
getClientCommandMgr(AdminClient adminclient)
Deprecated. As of release 7.0, replaced by
getCommandMgr(AdminClient)
|
|
getCommandGroupMetadata(java.lang.String commandGrp)
Returns the metadata for a particular command group.
|
|
getCommandMetadata(java.lang.String commandName)
Returns the command metadata for a particular command.
|
|
getCommandMgr()
Access method to get the CommandMgr instance.
|
|
getCommandMgr(AdminClient adminclient)
Access method to get the CommandMgr instance in client mode.
|
|
getCommandProviderHelper()
Returns a proper implementation of CommandProviderHelper for the current
command execution environment.
|
|
listAllCommands()
|
|
listCommandGroups()
Lists all the admin command groups.
|
|
listCommands()
Lists all the admin commands.
|
|
listCommands(java.lang.String commandGroup)
Lists all the admin commands in a particular command group.
|
|
loadCommand(java.io.InputStream serializedCmd)
Loads an admin command from its serialized format into memory.
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail
cmdMgr
- protected static CommandMgr cmdMgr
initialized
- protected static boolean initialized
Constructor Detail
CommandMgr
- public CommandMgr()
Method Detail
getCommandMgr
- public static CommandMgr getCommandMgr( )
If getClientCommandMgr(AdminClient)
has been called prior to
call this getCommandMgr()
then the same client command manager
will be returned.
Otherwise, it will return a server command manager if AdminService is
available, or return a local command manager if AdminService is not available.
The subsequence getCommandMgr()
call after this will return the same
server (or local) command manager.
getClientCommandMgr
- public static CommandMgr getClientCommandMgr( AdminClient adminclient)
- throws CommandMgrInitException
getCommandMgr(AdminClient)
getCommandMgr()
call after this getClientCommandMgr(AdminClient)
will return the same client command manager.
getCommandMgr
- public static CommandMgr getCommandMgr( AdminClient adminclient)
- throws CommandMgrInitException
getClientCommandMgr(AdminClient)
.
Unlike getClientCommandMgr(AdminClient)
, the subsequence
getCommandMgr()
call after this getCommandMgr(AdminClient)
will not return a client command manager. Caller to this method needs to
cache and manage the returned CommandMgr object for reuse.
adminclient
- the AdminClient object that represents a remote server for
command execution. getAdminClient
- public static AdminClient getAdminClient( )
getCommandMgr(AdminClient adminclient)
.
This method may return a null pointer if ClientCommandMgr has not been
initialized by calling getCommandMgr(AdminClient adminclient)
.
It is caller's responsibility to check the returned object, before using it.
listCommandGroups
- public abstract java.util.Collection listCommandGroups( )
- throws ConnectorException
- CommandException
listCommands
- public abstract java.util.Collection listCommands( java.lang.String commandGroup)
- throws ConnectorException
- CommandException
commandGroup
- a command group name. listCommands
- public abstract java.util.Collection listCommands( )
- throws ConnectorException
- CommandException
listAllCommands
- public abstract java.util.Collection listAllCommands( )
- throws ConnectorException
- CommandException
getCommandMetadata
- public abstract com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata getCommandMetadata( java.lang.String commandName)
- throws ConnectorException
- CommandNotFoundException
- CommandException
commandName
- an admin command name. CommandNotFoundException
- if the specified admin command is not found. getAllCommandMetadata
- public abstract java.util.Collection getAllCommandMetadata( )
- throws ConnectorException
- CommandException
getCommandGroupMetadata
- public abstract com.ibm.websphere.management.cmdframework.commandmetadata.CommandGroupMetadata getCommandGroupMetadata( java.lang.String commandGrp)
- throws ConnectorException
- CommandNotFoundException
- CommandException
commandGrp
- a command group name CommandNotFoundException
- if the specified command group is not found. getAllCommandGroupMetadata
- public abstract java.util.Collection getAllCommandGroupMetadata( )
- throws ConnectorException
- CommandNotFoundException
- CommandException
CommandNotFoundException
- if the specified command group is not found. createCommand
- public abstract AdminCommand createCommand( java.lang.String command)
- throws CommandNotFoundException
- CommandException
- ConnectorException
command
- an admin command name. CommandNotFoundException
- if the specified admin command is not found. loadCommand
- public abstract AdminCommand loadCommand( java.io.InputStream serializedCmd)
- throws CommandLoadException
- ConnectorException
- CommandException
serializedCmd
- an inputstream that contains a serialized admin command. CommandLoadException
- command framework failed to load the admin command. getCommandProviderHelper
- public abstract CommandProviderHelper getCommandProviderHelper( )