Package org.keycloak.utils
Class LockObjectsForModification
- java.lang.Object
- 
- org.keycloak.utils.LockObjectsForModification
 
- 
 public class LockObjectsForModification extends Object This flags the session that all information loaded from the stores should be locked as the service layer plans to modify it. This is just a hint to the underlying storage, and a store might choose to ignore it. The lock for any object retrieved from the session will be kept until the end of the transaction. If the store supports it, this could prevent exceptions due to optimistic locking problems later in the processing. If the caller retrieved objects without this wrapper, they would still be able to modify those objects, and those changes would be written to the store at the end of the transaction at the lastet, but they won't be locked.- Author:
- Alexander Schwartz
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static interfaceLockObjectsForModification.CallableWithoutThrowingAnException<V>static classLockObjectsForModification.Enabled
 - 
Constructor SummaryConstructors Constructor Description LockObjectsForModification()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisEnabled(KeycloakSession session, Class<?> model)static <V> VlockRealmsForModification(KeycloakSession session, LockObjectsForModification.CallableWithoutThrowingAnException<V> callable)static <V> VlockUserSessionsForModification(KeycloakSession session, LockObjectsForModification.CallableWithoutThrowingAnException<V> callable)
 
- 
- 
- 
Method Detail- 
isEnabledpublic static boolean isEnabled(KeycloakSession session, Class<?> model) 
 - 
lockUserSessionsForModificationpublic static <V> V lockUserSessionsForModification(KeycloakSession session, LockObjectsForModification.CallableWithoutThrowingAnException<V> callable) 
 - 
lockRealmsForModificationpublic static <V> V lockRealmsForModification(KeycloakSession session, LockObjectsForModification.CallableWithoutThrowingAnException<V> callable) 
 
- 
 
-