CliFunction (Apache Geode 1.15.4)

org.apache.geode.management.cli

## Class CliFunction<T>

- java.lang.Object
- - org.apache.geode.management.cli.CliFunction<T>

- All Implemented Interfaces:
    Serializable, Function<T>, org.apache.geode.internal.cache.execute.InternalFunction<T>, org.apache.geode.internal.InternalEntity, Identifiable<String>

      public abstract class CliFunction<T>
      extends Object
      implements org.apache.geode.internal.cache.execute.InternalFunction<T>

  An abstract function implementation to be extended by cli functions. Any cli function extending this class has to return a CliFunctionResult.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CliFunction()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `execute(FunctionContext<T> context)` The method which contains the logic to be executed.
    `abstract org.apache.geode.management.internal.functions.CliFunctionResult` | `executeFunction(FunctionContext<T> context)`
    `boolean` | `isHA()` Specifies whether the function is eligible for re-execution (in case of failure).

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

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

    - ### Methods inherited from interface org.apache.geode.internal.cache.execute.InternalFunction

      `getRequiredPermissions`

    - ### Methods inherited from interface org.apache.geode.cache.execute.Function

      `getId, getRequiredPermissions, hasResult, optimizeForWrite`

    - ### Methods inherited from interface org.apache.geode.lang.Identifiable

      `exists, find, remove`

- - ### Constructor Detail

    - #### CliFunction

          public CliFunction()

  - ### Method Detail

    - #### execute

          public final void execute(FunctionContext<T> context)

      Description copied from interface: `Function`
      The method which contains the logic to be executed. This method should be thread safe and may be invoked more than once on a given member for a single `Execution`. The context provided to this function is the one which was built using Execution. The contexts can be data dependent or data-independent so user should check to see if the context provided in parameter is instance of `RegionFunctionContext`.
      Specified by:
        `execute` in interface `Function<T>`
      Parameters:
        `context` - as created by `Execution`

    - #### isHA

          public boolean isHA()

      Description copied from interface: `Function`
      Specifies whether the function is eligible for re-execution (in case of failure).
      Specified by:
        `isHA` in interface `Function<T>`
      Returns:
        whether the function is eligible for re-execution.
      See Also:
        `FunctionContext.isPossibleDuplicate()`

    - #### executeFunction

          public abstract org.apache.geode.management.internal.functions.CliFunctionResult executeFunction(FunctionContext<T> context)
                                                                                                    throws Exception

      Throws:
        `Exception`