KeyOperationContext (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.cache.operations, class: KeyOperationContext

Package org.apache.geode.cache.operations

# Class KeyOperationContext

java.lang.Object
org.apache.geode.cache.operations.OperationContext
org.apache.geode.cache.operations.KeyOperationContext

Direct Known Subclasses:
  `DestroyOperationContext`, `InvalidateOperationContext`, `KeyValueOperationContext`

@Deprecated public abstract class KeyOperationContext extends OperationContext
Deprecated.
since Geode1.0, use `ResourcePermission` instead
Encapsulates a region operation that requires only a key object for the pre-operation case. The operations this class encapsulates are `OperationContext.OperationCode.DESTROY` and `OperationContext.OperationCode.CONTAINS_KEY`.

Since:
  GemFire 5.5

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class org.apache.geode.cache.operations.OperationContext

  `OperationContext.OperationCode`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `KeyOperationContext(Object key)`
  Deprecated.
  Constructor for the operation.
  `KeyOperationContext(Object key, boolean postOperation)`
  Deprecated.
  Constructor for the operation.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getCallbackArg()`
  Deprecated.
  Get the callback argument object for this operation.
  `Object`
  `getKey()`
  Deprecated.
  Get the key object for this operation.
  `abstract OperationContext.OperationCode`
  `getOperationCode()`
  Deprecated.
  Return the operation associated with the `OperationContext` object.
  `boolean`
  `isPostOperation()`
  Deprecated.
  True if the context is for post-operation.
  `void`
  `setCallbackArg(Object callbackArg)`
  Deprecated.
  Set the callback argument object for this operation.
  `protected void`
  `setPostOperation()`
  Deprecated.
  Set the post-operation flag to true.

  ### Methods inherited from class org.apache.geode.cache.operations.OperationContext

  `isClientUpdate, isClientUpdate`

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

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

- ## Constructor Details

  - ### KeyOperationContext

    public KeyOperationContext(Object key)
    Deprecated.
    Constructor for the operation.
    Parameters:
      `key` - the key for this operation

  - ### KeyOperationContext

    public KeyOperationContext(Object key, boolean postOperation)
    Deprecated.
    Constructor for the operation.
    Parameters:
      `key` - the key for this operation
      `postOperation` - true to set the post-operation flag

- ## Method Details

  - ### getOperationCode

    public abstract OperationContext.OperationCode getOperationCode()
    Deprecated.
    Return the operation associated with the `OperationContext` object.
    Specified by:
      `getOperationCode` in class `OperationContext`
    Returns:
      The `OperationCode` of this operation. This is one of `OperationContext.OperationCode.DESTROY` or `OperationContext.OperationCode.CONTAINS_KEY` for `KeyOperationContext`, and one of `OperationContext.OperationCode.GET` or `OperationContext.OperationCode.PUT` for `KeyValueOperationContext`.

  - ### isPostOperation

    public boolean isPostOperation()
    Deprecated.
    True if the context is for post-operation.
    Specified by:
      `isPostOperation` in class `OperationContext`
    Returns:
      whether the context is for post-operation

  - ### setPostOperation

    protected void setPostOperation()
    Deprecated.
    Set the post-operation flag to true.

  - ### getKey

    public Object getKey()
    Deprecated.
    Get the key object for this operation.
    Returns:
      the key object for this operation.

  - ### getCallbackArg

    public Object getCallbackArg()
    Deprecated.
    Get the callback argument object for this operation.
    Returns:
      the callback argument object for this operation.

  - ### setCallbackArg

    public void setCallbackArg(Object callbackArg)
    Deprecated.
    Set the callback argument object for this operation.
    Parameters:
      `callbackArg` - the callback argument object for this operation.