Class BaseUpdater<K,V>
java.lang.Object
org.keycloak.models.sessions.infinispan.changes.remote.updater.BaseUpdater<K,V>
- Type Parameters:
K
- The type of the Infinispan cache key.V
- The type of the Infinispan cache value.
- All Implemented Interfaces:
BiFunction<K,
,V, V> Updater<K,
V>
- Direct Known Subclasses:
AuthenticatedClientSessionUpdater
,LoginFailuresUpdater
,UserSessionUpdater
Base functionality of an
Updater
implementation.
It stores the Infinispan cache key, value, version, and it states. However, it does not keep track of the changed fields in the cache value, and it is the responsibility of the implementation to do that.
Implement the method isUnchanged()
to signal if the entity was modified or not.
-
Nested Class Summary
-
Field Summary
Fields inherited from interface org.keycloak.models.sessions.infinispan.changes.remote.updater.Updater
NO_VERSION
-
Constructor Summary
ModifierConstructorDescriptionprotected
BaseUpdater
(K cacheKey, V cacheValue, long versionRead, BaseUpdater.UpdaterState state) -
Method Summary
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.function.BiFunction
andThen, apply
Methods inherited from interface org.keycloak.models.sessions.infinispan.changes.remote.updater.Updater
computeExpiration, hasVersion, isTransient
-
Constructor Details
-
BaseUpdater
-
-
Method Details
-
getKey
-
getValue
-
getVersionRead
public final long getVersionRead()- Specified by:
getVersionRead
in interfaceUpdater<K,
V> - Returns:
- The entity version when reading for the first time from Infinispan.
-
isDeleted
public final boolean isDeleted() -
isCreated
public final boolean isCreated() -
isReadOnly
public final boolean isReadOnly()- Specified by:
isReadOnly
in interfaceUpdater<K,
V> - Returns:
true
if the entity was not changed.
-
markDeleted
public final void markDeleted()Description copied from interface:Updater
Marks the entity as deleted.- Specified by:
markDeleted
in interfaceUpdater<K,
V>
-
equals
-
hashCode
public int hashCode() -
toString
-
isUnchanged
protected abstract boolean isUnchanged()- Returns:
true
if the entity was changed after being created/read.
-