GemFire 6.5.1.2

com.gemstone.gemfire.cache.operations
Class KeyValueOperationContext

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
Direct Known Subclasses:
GetOperationContext, PutOperationContext

public abstract class KeyValueOperationContext
extends KeyOperationContext

Encapsulates a region operation that requires both key and serialized value for the pre-operation and post-operation cases.

Since:
5.5

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gemstone.gemfire.cache.operations.OperationContext
OperationContext.OperationCode
 
Constructor Summary
KeyValueOperationContext(Object key, Object value, boolean isObject)
          Constructor for the operation.
KeyValueOperationContext(Object key, Object value, boolean isObject, boolean postOperation)
          Constructor for the operation.
 
Method Summary
 byte[] getSerializedValue()
          Get the serialized value for this operation.
 Object getValue()
          Get the value for this operation.
 boolean isObject()
          Return true when the value is an object and not a raw byte array.
 void setSerializedValue(byte[] serializedValue, boolean isObject)
          Set the serialized value object for this operation.
 void setValue(Object value, boolean isObject)
          Set the result value of the object for this operation.
 
Methods inherited from class com.gemstone.gemfire.cache.operations.KeyOperationContext
getCallbackArg, getKey, getOperationCode, isPostOperation, setCallbackArg
 
Methods inherited from class com.gemstone.gemfire.cache.operations.OperationContext
isClientUpdate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KeyValueOperationContext

public KeyValueOperationContext(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

KeyValueOperationContext

public KeyValueOperationContext(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
Method Detail

getSerializedValue

public byte[] getSerializedValue()
Get the serialized value for this operation.

Returns:
the serialized value for this operation.

getValue

public Object getValue()
Get the value for this operation.

Returns:
the value for this operation.
Since:
6.5

isObject

public boolean isObject()
Return true when the value is an object and not a raw byte array.

Returns:
true when the value is an object; false when it is a raw byte array

setSerializedValue

public void setSerializedValue(byte[] serializedValue,
                               boolean isObject)
Set the serialized value object for this operation.

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

setValue

public void setValue(Object value,
                     boolean isObject)
Set the result value of the object for this operation.

Parameters:
value - the result of this operation; can be a serialized byte array or a deserialized object
isObject - true when the value is an object (either serialized or deserialized); false when it is a raw byte array
Since:
6.5

GemFire 6.5.1.2

Copyright © 2002-2010 GemStone Systems, Inc. All Rights Reserved.