Class SingleGfshCommand

  • All Implemented Interfaces:
    org.springframework.shell.core.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.
    • Constructor Detail

      • SingleGfshCommand

        public SingleGfshCommand()
    • Method Detail

      • updateConfigForGroup

        public abstract boolean updateConfigForGroup​(java.lang.String group,
                                                     CacheConfig config,
                                                     java.lang.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