GemFire 7.0.1

com.gemstone.gemfire.management.cli
Class CommandService

java.lang.Object
  extended by com.gemstone.gemfire.management.cli.CommandService

public abstract class CommandService
extends Object

Processes remote GemFire Command Line Interface (CLI) commands. Refer to the vFabric GemFire documentation for information regarding local vs. remote commands.

Since:
7.0

Constructor Summary
CommandService()
           
 
Method Summary
abstract  CommandStatement createCommandStatement(String commandString)
          Creates a CommandStatement from the specified command string.
static CommandService createLocalCommandService(Cache cache)
          Returns a newly created or existing instance of the CommandService associated with the specified Cache.
static CommandService getUsableLocalCommandService()
          Returns an existing 'usable' CommandService>.
abstract  boolean isUsable()
          Returns whether the underlying Cache exists and is not closed.
abstract  Result processCommand(String commandString)
          Processes the specified command string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandService

public CommandService()
Method Detail

isUsable

public abstract boolean isUsable()
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)
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.

createCommandStatement

public abstract CommandStatement createCommandStatement(String commandString)
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()

createLocalCommandService

public static final CommandService createLocalCommandService(Cache cache)
                                                      throws CommandServiceException
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.
Throws:
CommandServiceException - If command service could not be initialized.

getUsableLocalCommandService

public static final CommandService getUsableLocalCommandService()
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.

GemFire 7.0.1

Copyright © 1997-2013 VMware, Inc. All rights reserved.