GemFire 7.0

com.gemstone.gemfire.cache
Interface EntryEvent<K,V>

All Superinterfaces:
CacheEvent<K,V>
All Known Subinterfaces:
TimestampedEntryEvent

public interface EntryEvent<K,V>
extends CacheEvent<K,V>

Contains information about an event affecting an entry, including its identity and the the circumstances of the event. It is passed in to CacheListener, CapacityController, and CacheWriter.

Since:
3.0
See Also:
CacheListener, CacheWriter, RegionEvent

Method Summary
 K getKey()
          Returns the key.
 V getNewValue()
          Returns the value in the cache after this event.
 V getOldValue()
          Returns the value in the cache prior to this event.
 SerializedCacheValue<V> getSerializedNewValue()
          Returns the serialized form of the value in the cache after this event.
 SerializedCacheValue<V> getSerializedOldValue()
          Returns the serialized form of the value in the cache before this event.
 TransactionId getTransactionId()
          Gets the TransactionId for this EntryEvent.
 boolean hasClientOrigin()
          Returns true if this event originated on a client.
 boolean isBridgeEvent()
          Deprecated. as of 5.7 use hasClientOrigin() instead.
 boolean isLoad()
          Deprecated. as of GemFire 5.0, use Operation.isLoad() instead.
 boolean isLocalLoad()
          Deprecated. as of GemFire 5.0, use Operation.isLocalLoad() instead.
 boolean isNetLoad()
          Deprecated. as of GemFire 5.0, use Operation.isNetLoad() instead.
 boolean isNetSearch()
          Deprecated. as of GemFire 5.0, use Operation.isNetSearch() instead.
 boolean isOldValueAvailable()
          Returns true if the old value is "available".
 
Methods inherited from interface com.gemstone.gemfire.cache.CacheEvent
getCallbackArgument, getDistributedMember, getOperation, getRegion, isCallbackArgumentAvailable, isDistributed, isExpiration, isOriginRemote
 

Method Detail

getKey

K getKey()
Returns the key.

Returns:
the key

getOldValue

V getOldValue()
Returns the value in the cache prior to this event. When passed to an event handler after an event occurs, this value reflects the value that was in the cache in this VM, not necessarily the value that was in the cache VM that initiated the operation. In certain scenarios the old value may no longer be available in which case null is returned. This can happen for disk regions when the old value is on disk only.

Returns:
the old value in the cache prior to this event. If the entry did not exist, was invalid, or was not available, then null is returned.

getSerializedOldValue

SerializedCacheValue<V> getSerializedOldValue()
Returns the serialized form of the value in the cache before this event.

Returns:
the serialized form of the value in the cache before this event
Since:
5.5

getNewValue

V getNewValue()
Returns the value in the cache after this event.

Returns:
the value in the cache after this event

getSerializedNewValue

SerializedCacheValue<V> getSerializedNewValue()
Returns the serialized form of the value in the cache after this event.

Returns:
the serialized form of the value in the cache after this event
Since:
5.5

isLocalLoad

@Deprecated
boolean isLocalLoad()
Deprecated. as of GemFire 5.0, use Operation.isLocalLoad() instead.

Returns true if this event resulted from a loader running in this cache. Note that this will be true even if the local loader called netSearch. If this event is for a Partitioned Region, then true will be returned if the loader ran in the same VM as where the data is hosted. If true is returned, and CacheEvent.isOriginRemote() is true, it means the data is not hosted locally, but the loader was run local to the data.

Returns:
true if this event resulted from local loader execution

isNetLoad

@Deprecated
boolean isNetLoad()
Deprecated. as of GemFire 5.0, use Operation.isNetLoad() instead.

Returns true if this event resulted from a loader running that was remote from the cache that requested it, i.e., a netLoad. Note that the cache that requested the netLoad may not be this cache in which case isOriginRemote will also return true.

Returns:
true if this event resulted from a netLoad

isLoad

@Deprecated
boolean isLoad()
Deprecated. as of GemFire 5.0, use Operation.isLoad() instead.

Returns true if this event resulted from a loader.

Returns:
true if isLocalLoad or isNetLoad

isNetSearch

@Deprecated
boolean isNetSearch()
Deprecated. as of GemFire 5.0, use Operation.isNetSearch() instead.

Returns true if this event resulted from a netSearch. If the netSearch was invoked by a loader however, this will return false and isLocalLoad() or isNetLoad() will return true instead.

Returns:
true if this event resulted from a netSearch

getTransactionId

TransactionId getTransactionId()
Gets the TransactionId for this EntryEvent.

Returns:
the ID of the transaction that performed the operation that generated this event; null if no transaction involved.
Since:
4.0

isBridgeEvent

@Deprecated
boolean isBridgeEvent()
Deprecated. as of 5.7 use hasClientOrigin() instead.

Returns true if this event originated on a client.

Returns:
true if this event originated on a client.
Since:
5.1

hasClientOrigin

boolean hasClientOrigin()
Returns true if this event originated on a client.

Returns:
true if this event originated on a client.
Since:
5.7

isOldValueAvailable

boolean isOldValueAvailable()
Returns true if the old value is "available". Not available means that an old value existed but it could not be obtained or it was deemed too expensive to obtain. Note that getOldValue() will return null when this method returns false.

Since:
6.0

GemFire 7.0

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