com.ibm.websphere.management.cmdframework

Class CommandMgr

  1. java.lang.Object
  2. extended bycom.ibm.websphere.management.cmdframework.CommandMgr

  1. public abstract class CommandMgr
  2. extends java.lang.Object
Main interface for the command framework component.

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:


Field Summary

Modifier and Type Field and Description
  1. protected static
  2. CommandMgr
cmdMgr
  1. protected static
  2. boolean
initialized

Constructor Summary

Constructor and Description
CommandMgr()

Method Summary

Modifier and Type Method and Description
  1. abstract
  2. AdminCommand
createCommand(java.lang.String command)
Creates an admin command
  1. static
  2. AdminClient
getAdminClient()
Get the AdminClient associate with the most recent ClientCommandMgr called by getCommandMgr(AdminClient adminclient).
  1. abstract
  2. java.util.Collection
getAllCommandGroupMetadata()
Returns the metadata for a all the command groups.
  1. abstract
  2. java.util.Collection
getAllCommandMetadata()
  1. static
  2. CommandMgr
getClientCommandMgr(AdminClient adminclient)
Deprecated. As of release 7.0, replaced by getCommandMgr(AdminClient)
  1. abstract
  2. com.ibm.websphere.management.cmdframework.commandmetadata.CommandGroupMetadata
getCommandGroupMetadata(java.lang.String commandGrp)
Returns the metadata for a particular command group.
  1. abstract
  2. com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata
getCommandMetadata(java.lang.String commandName)
Returns the command metadata for a particular command.
  1. static
  2. CommandMgr
getCommandMgr()
Access method to get the CommandMgr instance.
  1. static
  2. CommandMgr
getCommandMgr(AdminClient adminclient)
Access method to get the CommandMgr instance in client mode.
  1. abstract
  2. CommandProviderHelper
getCommandProviderHelper()
Returns a proper implementation of CommandProviderHelper for the current command execution environment.
  1. abstract
  2. java.util.Collection
listAllCommands()
  1. abstract
  2. java.util.Collection
listCommandGroups()
Lists all the admin command groups.
  1. abstract
  2. java.util.Collection
listCommands()
Lists all the admin commands.
  1. abstract
  2. java.util.Collection
listCommands(java.lang.String commandGroup)
Lists all the admin commands in a particular command group.
  1. abstract
  2. AdminCommand
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

  1. protected static CommandMgr cmdMgr

initialized

  1. protected static boolean initialized

Constructor Detail

CommandMgr

  1. public CommandMgr()

Method Detail

getCommandMgr

  1. public static CommandMgr getCommandMgr( )
Access method to get the CommandMgr instance.
Returns:
the CommandMgr instance. Returns null if the CommandMgrinitializer failed to initialize command manager properly.

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

  1. public static CommandMgr getClientCommandMgr( AdminClient adminclient)
  2. throws CommandMgrInitException
Deprecated. As of release 7.0, replaced by getCommandMgr(AdminClient)
Access method to get the CommandMgr instance in client mode. The subsequence getCommandMgr() call after this getClientCommandMgr(AdminClient) will return the same client command manager.
Returns:
the CommandMgr instance.
Throws:
CommandMgrInitException.

getCommandMgr

  1. public static CommandMgr getCommandMgr( AdminClient adminclient)
  2. throws CommandMgrInitException
Access method to get the CommandMgr instance in client mode. As of release 7.0, this method is the replacement of 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.
Parameters:
adminclient - the AdminClient object that represents a remote server for command execution.
Returns:
A new CommandMgr instance.
Throws:

getAdminClient

  1. public static AdminClient getAdminClient( )
Get the AdminClient associate with the most recent ClientCommandMgr called by 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.
Returns:
an AdminClient object that is associate with the ClientCommandMgr.

listCommandGroups

  1. public abstract java.util.Collection listCommandGroups( )
  2. throws ConnectorException
  3. CommandException
Lists all the admin command groups.
Returns:
a collection of the command group names.
Throws:

listCommands

  1. public abstract java.util.Collection listCommands( java.lang.String commandGroup)
  2. throws ConnectorException
  3. CommandException
Lists all the admin commands in a particular command group.
Parameters:
commandGroup - a command group name.
Returns:
a collection of admin command names in the specified command group.
Throws:

listCommands

  1. public abstract java.util.Collection listCommands( )
  2. throws ConnectorException
  3. CommandException
Lists all the admin commands.
Returns:
a collection of admin command names.
Throws:

listAllCommands

  1. public abstract java.util.Collection listAllCommands( )
  2. throws ConnectorException
  3. CommandException
Throws:

getCommandMetadata

  1. public abstract com.ibm.websphere.management.cmdframework.commandmetadata.CommandMetadata getCommandMetadata( java.lang.String commandName)
  2. throws ConnectorException
  3. CommandNotFoundException
  4. CommandException
Returns the command metadata for a particular command.
Parameters:
commandName - an admin command name.
Returns:
the command metadata of the specified admin command.
Throws:
CommandNotFoundException - if the specified admin command is not found.

getAllCommandMetadata

  1. public abstract java.util.Collection getAllCommandMetadata( )
  2. throws ConnectorException
  3. CommandException
Throws:

getCommandGroupMetadata

  1. public abstract com.ibm.websphere.management.cmdframework.commandmetadata.CommandGroupMetadata getCommandGroupMetadata( java.lang.String commandGrp)
  2. throws ConnectorException
  3. CommandNotFoundException
  4. CommandException
Returns the metadata for a particular command group.
Parameters:
commandGrp - a command group name
Returns:
metadata for the specified command group.
Throws:
CommandNotFoundException - if the specified command group is not found.

getAllCommandGroupMetadata

  1. public abstract java.util.Collection getAllCommandGroupMetadata( )
  2. throws ConnectorException
  3. CommandNotFoundException
  4. CommandException
Returns the metadata for a all the command groups.
Returns:
Collection of metadata for the command groups.
Throws:
CommandNotFoundException - if the specified command group is not found.

createCommand

  1. public abstract AdminCommand createCommand( java.lang.String command)
  2. throws CommandNotFoundException
  3. CommandException
  4. ConnectorException
Creates an admin command
Parameters:
command - an admin command name.
Returns:
an admin Command instance for the specified command name.
Throws:
CommandNotFoundException - if the specified admin command is not found.

loadCommand

  1. public abstract AdminCommand loadCommand( java.io.InputStream serializedCmd)
  2. throws CommandLoadException
  3. ConnectorException
  4. CommandException
Loads an admin command from its serialized format into memory.
Parameters:
serializedCmd - an inputstream that contains a serialized admin command.
Returns:
an instance of admin Command.
Throws:
CommandLoadException - command framework failed to load the admin command.

getCommandProviderHelper

  1. public abstract CommandProviderHelper getCommandProviderHelper( )
Returns a proper implementation of CommandProviderHelper for the current command execution environment.