CommandService (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.management.cli, class: CommandService

Package org.apache.geode.management.cli

# Class CommandService

java.lang.Object
org.apache.geode.management.cli.CommandService

@Deprecated public abstract class CommandService extends Object
Deprecated.
since 1.3 use OnlineCommandProcessor directly
Processes remote GemFire Command Line Interface (CLI) commands. Refer to the vFabric GemFire documentation for information regarding local vs. remote commands.

NOTE: `CommandService` is currently available only on GemFire Manager nodes.

Since:
  GemFire 7.0

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected static final Map<String,String>`
  `EMPTY_ENV`
  Deprecated.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `CommandService()`
  Deprecated.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `abstract CommandStatement`
  `createCommandStatement(String commandString)`
  Deprecated.
  since Geode 1.3, simply call processCommand to execute the command
  `protected abstract CommandStatement`
  `createCommandStatement(String commandString, Map<String,String> env)`
  Deprecated.
  since Geode 1.3, simply call processCommand to execute the command
  `static CommandService`
  `createLocalCommandService(Cache cache)`
  Deprecated.
  Returns a newly created or existing instance of the `CommandService` associated with the specified `Cache`.
  `static CommandService`
  `getUsableLocalCommandService()`
  Deprecated.
  Returns an existing 'usable' `CommandService`.
  `abstract boolean`
  `isUsable()`
  Deprecated.
  Returns whether the underlying `Cache` exists and is not closed.
  `abstract Result`
  `processCommand(String commandString)`
  Deprecated.
  Processes the specified command string.
  `protected abstract Result`
  `processCommand(String commandString, Map<String,String> env)`
  Deprecated.
  Processes the specified command string.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### EMPTY_ENV

    @Immutable protected static final Map<String,String> EMPTY_ENV
    Deprecated.

- ## Constructor Details

  - ### CommandService

    public CommandService()
    Deprecated.

- ## Method Details

  - ### isUsable

    public abstract boolean isUsable()
    Deprecated.
    Returns whether the underlying `Cache` exists and is not closed. The Cache must be ready in order for commands to be processed using this `CommandService`. A call to this method should be made before attempting to process commands.
    Returns:
      True if the `Cache` exists and is not closed, false otherwise.

  - ### processCommand

    public abstract Result processCommand(String commandString)
    Deprecated.
    Processes the specified command string. Only remote commands can be processed using this method. Refer to the vFabric GemFire documentation for details.
    Parameters:
      `commandString` - Command string to be processed.
    Returns:
      The `Result` of the execution of this command string.

  - ### processCommand

    protected abstract Result processCommand(String commandString, Map<String,String> env)
    Deprecated.
    Processes the specified command string. Only remote commands can be processed using this method. Refer to the vFabric GemFire documentation for details.
    Parameters:
      `commandString` - Command string to be processed.
      `env` - Environmental values that will be used during the execution of this command.
    Returns:
      The `Result` of the execution of this command string.

  - ### createCommandStatement

    @Deprecated public abstract CommandStatement createCommandStatement(String commandString)
    Deprecated.
    since Geode 1.3, simply call processCommand to execute the command
    Creates a `CommandStatement` from the specified command string. Only remote commands can be processed using this method. Refer to the vFabric GemFire documentation for details.
    Parameters:
      `commandString` - Command string from which to create a `CommandStatement`.
    Returns:
      A `CommandStatement` which can be used to repeatedly process the same command.
    See Also:
      - `CommandStatement.process()`

  - ### createCommandStatement

    @Deprecated protected abstract CommandStatement createCommandStatement(String commandString, Map<String,String> env)
    Deprecated.
    since Geode 1.3, simply call processCommand to execute the command
    Creates a `CommandStatement` from the specified command string. Only remote commands can be processed using this method. Refer to the vFabric GemFire documentation for details.
    Parameters:
      `commandString` - Command string from which to create a `CommandStatement`.
      `env` - Environmental values that will be used during the execution of this command.
    Returns:
      A `CommandStatement` which can be used to repeatedly process the same command.
    See Also:
      - `CommandStatement.process()`

  - ### createLocalCommandService

    public static CommandService createLocalCommandService(Cache cache) throws CommandServiceException
    Deprecated.
    Returns a newly created or existing instance of the `CommandService` associated with the specified `Cache`.
    Parameters:
      `cache` - Underlying `Cache` instance to be used to create a Command Service.
    Returns:
      a newly created or existing instance of the `CommandService` associated with the specified `Cache`
    Throws:
      `CommandServiceException` - If command service could not be initialized.

  - ### getUsableLocalCommandService

    public static CommandService getUsableLocalCommandService()
    Deprecated.
    Returns an existing 'usable' `CommandService`. A `CommandService` is considered usable if at has an underlying `Cache` which is not closed.
    Returns:
      A usable `CommandService` or null if one cannot be found.