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

Package org.apache.geode.management.cli

# Class SingleGfshCommand

java.lang.Object
org.apache.geode.management.cli.GfshCommand
org.apache.geode.management.cli.SingleGfshCommand

All Implemented Interfaces:
  `org.apache.geode.management.internal.cli.CommandMarker`

@Experimental public abstract class SingleGfshCommand extends GfshCommand
Command class that extends this class can only have one single command method, * i.e only one method that is annotated with @CliCommand. this is also specific for commands that will need to update cluster configuration. Child classes are required to implement the "updateConfigForGroup" method.

- ## Field Summary

  ### Fields inherited from class org.apache.geode.management.cli.GfshCommand

  `EXPERIMENTAL`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SingleGfshCommand()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `affectsClusterConfiguration()`
  For those commands that could possibly change the cluster configuration, they need to override this method to return true.
  `abstract boolean`
  `updateConfigForGroup(String group, CacheConfig config, Object configObject)`
  Implement this method for updating the configuration of a given group the implementation should update the passed in config object with appropriate changes if for any reason config can't be updated.

  ### Methods inherited from class org.apache.geode.management.cli.GfshCommand

  `authorize, authorize, authorize, executeAndGetFunctionResult, executeFunction, executeFunction, executeFunctionAndGetFunctionResult, findAllLocators, findAllOtherLocators, findAnyMembersForRegion, findMember, findMembers, findMembersForRegion, findMembersIncludingLocators, getAllMembers, getAllNormalMembers, getCache, getClusterManagementService, getConfigurationPersistenceService, getManagementService, getMember, getMembers, getMembersFunctionExecutor, getMembersIncludingLocators, getNormalMembersWithSameOrNewerVersion, getSubject, hasCacheSet, isOnlineCommandAvailable, isSharedConfigurationRunning, poll, setCache`

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

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

- ## Constructor Details

  - ### SingleGfshCommand

    public SingleGfshCommand()

- ## Method Details

  - ### updateConfigForGroup

    public abstract boolean updateConfigForGroup(String group, CacheConfig config, Object configObject)
    Implement this method for updating the configuration of a given group the implementation should update the passed in config object with appropriate changes if for any reason config can't be updated. throw a RuntimeException stating the reason.
    Parameters:
      `group` - the name of the group to update cluster config for
      `config` - the configuration object, never null
      `configObject` - the return value of CommandResult.getConfigObject. CommandResult is the return value of your command method.
    Returns:
      a boolean indicating whether a change to the cluster configuration was persisted.

  - ### affectsClusterConfiguration

    public boolean affectsClusterConfiguration()
    Description copied from class: `GfshCommand`
    For those commands that could possibly change the cluster configuration, they need to override this method to return true.
    Overrides:
      `affectsClusterConfiguration` in class `GfshCommand`
    Returns:
      whether the command may change the cluster configuration