GemFire 7.0

com.gemstone.gemfire.management.cli
Class CommandService

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

public abstract class CommandService
extends Object

Can be used to process GemFire Command Line Interface (CLI) commands using API.

Note that only remote commands can be processed using this method. Please refer vFabric GemFire documentation for details.

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 the instance of CommandService associated with the specified Cache.
static CommandService getUsableLocalCommandService()
          Returns an existing 'usable' CommandService if any or null.
abstract  boolean isUsable()
          Indicates whether the underlying Cache exists & is not closed so that commands can be processed using this CommandService.
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()
Indicates whether the underlying Cache exists & is not closed so that commands can be processed using this CommandService. This method should be used before processing commands.

Returns:
true if the underlying Cache is not yet closed, false otherwise

processCommand

public abstract Result processCommand(String commandString)
Processes the specified Command String. Note that only remote commands can be processed using this method. Please refer vFabric GemFire documentation for details.

Parameters:
commandString - command string to be processed.
Returns:
Result which can be iterated through to retrieve the result of command processing as String(s)

createCommandStatement

public abstract CommandStatement createCommandStatement(String commandString)
Creates a CommandStatement from the specified Command String. Note that only remote commands can be processed using this method. Please refer vFabric GemFire documentation for details.

Parameters:
commandString - command string for which CommandStatement is required
Returns:
CommandStatement which can be used later to process the same command string repeatedly.
See Also:
CommandStatement.process()

createLocalCommandService

public static final CommandService createLocalCommandService(Cache cache)
                                                      throws CommandServiceException
Returns the instance of CommandService associated with the specified Cache. If there exists a CommandService, it will be returned or a new instance will be created

Parameters:
cache - Underlying Cache instance to be used to create a Command Service
Returns:
CommandService instance
Throws:
CommandServiceException - if command service couldn't be initialized

getUsableLocalCommandService

public static final CommandService getUsableLocalCommandService()
Returns an existing 'usable' CommandService if any or null. 'usable' is the one whose underlying Cache is not closed

Returns:
existing 'usable' CommandService if any or null

GemFire 7.0

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