Interface ChangeRecord<K,V>
- 
public interface ChangeRecord<K,V>Provides a mechanism to represent and mutate a Cache Entry that was changed in a Federated Cache.ChangeRecords are typically provided toEventInterceptors as part of aFederatedChangeEventfor the purpose of inspecting and possibly modifying an entry prior to it being committed.EventInterceptors may choose toreject the changeorchange the value. When no change is specified the modified value is committed.Any updates to a
ChangeRecordwill overwrite the modified Entry and thus the updated value when the change is committed.When
ChangeRecordis for a local participant, the original and local entry will be the same.- Author:
 - bb
 
 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceChangeRecord.Entry<K,V>Represents the key, value and name of the Participant from which the entry originated. 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ChangeRecord<Binary,Binary>getBinaryChangeRecord()com.tangosol.net.events.federation.FederatedChangeEvent.TypegetEventType()The type of the FederatedChangeEvent.KgetKey()Obtain the key of the changedChangeRecord.Entry.ChangeRecord.Entry<K,V>getLocalEntry()Obtains a representation ofChangeRecord.Entryas it appears in the local participant.ChangeRecord.Entry<K,V>getModifiedEntry()Obtain a representation of the modifiedChangeRecord.Entry.ChangeRecord.Entry<K,V>getOriginalEntry()Obtain a representation of theChangeRecord.Entryprior to any changes occurring.booleanisDeleted()Determine if the modified entry in the ChangeRecord was deleted.booleanisLocalOnly()Determine whether the change represented by this ChangeRecord is local only, therefore not federated.booleanisSynthetic()Determine if this Entry has been synthetically mutated.voidrejectChange()Signal that the modifiedChangeRecord.Entryshould not be applied.voidsetLocalOnly(boolean bLocal)Set the local only flag to indicate that the change is not federated.voidsetValue(V newValue)Update the modifiedChangeRecord.Entryvalue.voidsetValue(V newValue, boolean fSynthetic)Update the modifiedChangeRecord.Entryvalue with a synthetic flag.<T> voidupdate(ValueUpdater<V,T> updater, T oValue)Update the modified Entry's value using the givenValueUpdater. 
 - 
 
- 
- 
Method Detail
- 
getKey
K getKey()
Obtain the key of the changedChangeRecord.Entry.- Returns:
 - the entry key
 
 
- 
getModifiedEntry
ChangeRecord.Entry<K,V> getModifiedEntry()
Obtain a representation of the modifiedChangeRecord.Entry.This
ChangeRecord.Entrywill be used to modify the associatedChangeRecord.Entryin the destination participant.- Returns:
 - modified entry
 
 
- 
getOriginalEntry
ChangeRecord.Entry<K,V> getOriginalEntry()
Obtain a representation of theChangeRecord.Entryprior to any changes occurring.This is typically a representation of the
ChangeRecord.Entryat the source participant prior to a change occurring.- Returns:
 - the original entry
 
 
- 
getLocalEntry
ChangeRecord.Entry<K,V> getLocalEntry()
Obtains a representation ofChangeRecord.Entryas it appears in the local participant.- Returns:
 - the local entry
 
 
- 
getEventType
com.tangosol.net.events.federation.FederatedChangeEvent.Type getEventType()
The type of the FederatedChangeEvent.- Returns:
 - the type of the FederatedChangeEvent
 - Since:
 - 12.2.1.0.2
 
 
- 
setValue
void setValue(V newValue)
Update the modifiedChangeRecord.Entryvalue.This method can potentially cause the change to be propagated back to the origin participant. Care must be taken to avoid any recursive ping-pong cycles.
- Parameters:
 newValue- new value for the modified entry
 
- 
setValue
void setValue(V newValue, boolean fSynthetic)
Update the modifiedChangeRecord.Entryvalue with a synthetic flag.This method can potentially cause the change to be propagated back to the origin participant. Care must be taken to avoid any recursive ping-pong cycles.
Note: Marking a change as synthetic will have different behavior depending on the federation event type: COMMITTING_LOCAL - the change will not be federated to other clusters and CacheStores will not be called. REPLICATING - setting the change synthetic is not allowed. An UnsupportedOperationException will be thrown. COMMITTING_REMOTE - the change will be applied as a synthetic change. CacheStores will not be triggered and federation will not forward the change to other clusters from this destination cluster.
- Parameters:
 newValue- new value for the modified entryfSynthetic- a flag to indicate whether the update is synthetic- Since:
 - 12.2.1.4.1
 
 
- 
update
<T> void update(ValueUpdater<V,T> updater, T oValue)
Update the modified Entry's value using the givenValueUpdater.- Parameters:
 updater- a ValueUpdater used to modify the Entry's valueoValue- the new value for this Entry
 
- 
rejectChange
void rejectChange()
Signal that the modifiedChangeRecord.Entryshould not be applied. The localChangeRecord.Entryshould remain unchanged. 
- 
isDeleted
boolean isDeleted()
Determine if the modified entry in the ChangeRecord was deleted.- Returns:
 - true if the entry was deleted
 
 
- 
getBinaryChangeRecord
ChangeRecord<Binary,Binary> getBinaryChangeRecord()
- Returns:
 - Binary ChangeRecord
 
 
- 
setLocalOnly
void setLocalOnly(boolean bLocal)
Set the local only flag to indicate that the change is not federated.Note: this setting is only applicable to
FederatedChangeEvent.Type.COMMITTING_LOCALevents.- Parameters:
 bLocal- a flag to indicate whether to keep the change local only- Since:
 - 12.2.1.0.3
 
 
- 
isLocalOnly
boolean isLocalOnly()
Determine whether the change represented by this ChangeRecord is local only, therefore not federated.Note: this setting is only applicable to
FederatedChangeEvent.Type.COMMITTING_LOCALevents.- Returns:
 - a boolean value to indicate whether the change is local only
 - Since:
 - 12.2.1.0.3
 
 
- 
isSynthetic
boolean isSynthetic()
Determine if this Entry has been synthetically mutated. This method returnsfalseif either a non-synthetic update was made or the entry has not been modified.- Returns:
 - true if the Entry has been synthetically mutated
 - Since:
 - 12.2.1.4.1
 
 
 - 
 
 -