GemFire 7.0

com.gemstone.gemfire.cache.operations
Class PutOperationContext

java.lang.Object
  extended by com.gemstone.gemfire.cache.operations.OperationContext
      extended by com.gemstone.gemfire.cache.operations.KeyOperationContext
          extended by com.gemstone.gemfire.cache.operations.KeyValueOperationContext
              extended by com.gemstone.gemfire.cache.operations.PutOperationContext

public class PutOperationContext
extends KeyValueOperationContext

Encapsulates an OperationContext.OperationCode.PUT region operation having both key and value objects for for both the pre-operation case and for post-operation updates.

Since:
5.5

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gemstone.gemfire.cache.operations.OperationContext
OperationContext.OperationCode
 
Field Summary
static byte CREATE
          Indicates that the operation results in a create of the key.
static byte UNKNOWN
          Indicates that it is not known whether the operation results in a create or in an update.
static byte UPDATE
          Indicates that the operation results in an update of the key.
 
Constructor Summary
PutOperationContext(Object key, Object value, boolean isObject)
          Constructor for the operation.
PutOperationContext(Object key, Object value, boolean isObject, boolean postOperation)
          Constructor for the operation.
PutOperationContext(Object key, Object value, boolean isObject, byte opType, boolean isPostOperation)
          Constructor for the operation.
 
Method Summary
 OperationContext.OperationCode getOperationCode()
          Return the operation associated with the OperationContext object.
 byte getOpType()
          Return whether the operation is a create or update or unknown.
 
Methods inherited from class com.gemstone.gemfire.cache.operations.KeyValueOperationContext
getSerializedValue, getValue, isObject, setSerializedValue, setValue
 
Methods inherited from class com.gemstone.gemfire.cache.operations.KeyOperationContext
getCallbackArg, getKey, isPostOperation, setCallbackArg
 
Methods inherited from class com.gemstone.gemfire.cache.operations.OperationContext
isClientUpdate, isClientUpdate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UNKNOWN

public static final byte UNKNOWN
Indicates that it is not known whether the operation results in a create or in an update. The authorization callback should explicitly use the Region.containsKey(java.lang.Object) method to determine it when required.

See Also:
Constant Field Values

CREATE

public static final byte CREATE
Indicates that the operation results in a create of the key.

See Also:
Constant Field Values

UPDATE

public static final byte UPDATE
Indicates that the operation results in an update of the key.

See Also:
Constant Field Values
Constructor Detail

PutOperationContext

public PutOperationContext(Object key,
                           Object value,
                           boolean isObject)
Constructor for the operation.

Parameters:
key - the key for this operation
value - the value for this operation
isObject - true when the value is an object; false when it is a raw byte array
Since:
6.5

PutOperationContext

public PutOperationContext(Object key,
                           Object value,
                           boolean isObject,
                           boolean postOperation)
Constructor for the operation.

Parameters:
key - the key for this operation
value - the value for this operation
isObject - true when the value is an object; false when it is a raw byte array
postOperation - true if the context is at the time of sending updates
Since:
6.5

PutOperationContext

public PutOperationContext(Object key,
                           Object value,
                           boolean isObject,
                           byte opType,
                           boolean isPostOperation)
Constructor for the operation.

Parameters:
key - the key for this operation
value - the value for this operation
isObject - true when the value is an object; false when it is a raw byte array
opType - flag to indicate whether the operation is create/update or unknown
isPostOperation - true if the context is at the time of sending updates
Since:
6.5
Method Detail

getOperationCode

public OperationContext.OperationCode getOperationCode()
Return the operation associated with the OperationContext object.

Specified by:
getOperationCode in class KeyOperationContext
Returns:
OperationCode.PUT.

getOpType

public byte getOpType()
Return whether the operation is a create or update or unknown. The user should check against CREATE, UPDATE, UNKNOWN. For the UNKNOWN case, the authorization callback should explicitly invoke Region.containsKey(java.lang.Object) to determine if it is create or update when required.

Returns:
one of CREATE, UPDATE, UNKNOWN

GemFire 7.0

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