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,RootAuthenticationSessionUpdater,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
Nested Classes -
Field Summary
Fields inherited from interface org.keycloak.models.sessions.infinispan.changes.remote.updater.Updater
NO_VERSION -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBaseUpdater(K cacheKey, V cacheValue, long versionRead, BaseUpdater.UpdaterState state) -
Method Summary
Modifier and TypeMethodDescriptionbooleanfinal KgetKey()final VgetValue()final longinthashCode()final booleanfinal booleanfinal booleanbooleanprotected abstract booleanfinal voidMarks the entity as deleted.protected final voidResets theBaseUpdater.UpdaterStateto its initial value.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThen, applyMethods inherited from interface org.keycloak.models.sessions.infinispan.changes.remote.updater.Updater
computeExpiration, hasVersion
-
Constructor Details
-
BaseUpdater
-
-
Method Details
-
getKey
-
getValue
-
getVersionRead
public final long getVersionRead()- Specified by:
getVersionReadin 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:
isReadOnlyin interfaceUpdater<K,V> - Returns:
trueif the entity was not changed.
-
markDeleted
public final void markDeleted()Description copied from interface:UpdaterMarks the entity as deleted.- Specified by:
markDeletedin interfaceUpdater<K,V>
-
isTransient
public boolean isTransient()- Specified by:
isTransientin interfaceUpdater<K,V> - Returns:
trueif the entity is transient and shouldn't be stored in the Infinispan cache.
-
equals
-
hashCode
public int hashCode() -
toString
-
resetState
protected final void resetState()Resets theBaseUpdater.UpdaterStateto its initial value. -
isUnchanged
protected abstract boolean isUnchanged()- Returns:
trueif the entity was changed after being created/read.
-