public interface EntryEvent<K,V> extends CacheEvent<K,V>
CacheListener
, CapacityController
, and CacheWriter
.
If this event originated from a region stored off heap then this event can
only be used as long as the notification method that obtained it has not returned.
For example in your implementation of CacheListener.afterUpdate(EntryEvent)
the event parameter
is only valid until your afterUpdate method returns. It is not safe to store instances of this
class and use them later when using off heap storage.
Attempts to access off-heap data from this event after it has expired will result in an
IllegalStateException.
CacheListener
,
CacheWriter
,
RegionEvent
Modifier and Type | Method and Description |
---|---|
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". |
getCallbackArgument, getDistributedMember, getOperation, getRegion, isCallbackArgumentAvailable, isDistributed, isExpiration, isOriginRemote
K getKey()
V getOldValue()
null
is returned.
This can happen for disk regions when the old value is on disk only.java.lang.IllegalStateException
- if off-heap and called after the method that was passed this EntryEvent returns.SerializedCacheValue<V> getSerializedOldValue()
java.lang.IllegalStateException
- if off-heap and called after the method that was passed this EntryEvent returns.V getNewValue()
java.lang.IllegalStateException
- if off-heap and called after the method that was passed this EntryEvent returns.SerializedCacheValue<V> getSerializedNewValue()
java.lang.IllegalStateException
- if off-heap and called after the method that was passed this EntryEvent returns.@Deprecated boolean isLocalLoad()
Operation.isLocalLoad()
instead.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.@Deprecated boolean isNetLoad()
Operation.isNetLoad()
instead.isOriginRemote
will also return true.@Deprecated boolean isLoad()
Operation.isLoad()
instead.@Deprecated boolean isNetSearch()
Operation.isNetSearch()
instead.netSearch
. If the netSearch
was invoked by a loader however, this will return false and isLocalLoad()
or isNetLoad()
will return true instead.TransactionId getTransactionId()
@Deprecated boolean isBridgeEvent()
hasClientOrigin()
instead.boolean hasClientOrigin()
boolean isOldValueAvailable()
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
.