Class FileMapKeycloakTransaction<V extends AbstractEntity & UpdatableEntity,M>
- java.lang.Object
-
- org.keycloak.models.map.storage.chm.ConcurrentHashMapKeycloakTransaction<String,V,M>
-
- org.keycloak.models.map.storage.file.FileMapKeycloakTransaction<V,M>
-
- All Implemented Interfaces:
KeycloakTransaction,HasRealmId,MapKeycloakTransaction<V,M>
public class FileMapKeycloakTransaction<V extends AbstractEntity & UpdatableEntity,M> extends ConcurrentHashMapKeycloakTransaction<String,V,M>
MapKeycloakTransactionimplementation used with the file map storage.- Author:
- Stefan Guilhen
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.keycloak.models.map.storage.chm.ConcurrentHashMapKeycloakTransaction
ConcurrentHashMapKeycloakTransaction.MapTaskWithValue
-
-
Field Summary
-
Fields inherited from class org.keycloak.models.map.storage.chm.ConcurrentHashMapKeycloakTransaction
active, cloner, fieldPredicates, keyConverter, map, realmIdEntityField, rollback, tasks
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcommit()static <V extends AbstractEntity & UpdatableEntity,M>
FileMapKeycloakTransaction<V,M>newInstance(Class<V> entityClass, Function<String,Path> dataDirectoryFunc, Function<V,String[]> suggestedPath, boolean isExpirableEntity, Map<SearchableModelField<? super M>,MapModelCriteriaBuilder.UpdatePredicatesFunc<String,V,M>> fieldPredicates)VregisterEntityForChanges(V origEntity)Returns a deep clone of an entity.booleanremoveIfExists(Path path)voidrollback()voidtouch(Path path)-
Methods inherited from class org.keycloak.models.map.storage.chm.ConcurrentHashMapKeycloakTransaction
addTask, begin, create, delete, delete, exists, getCount, getRealmId, getRollbackOnly, isActive, read, read, setRealmId, setRollbackOnly, updateIfChanged
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.keycloak.models.map.storage.MapKeycloakTransaction
exists
-
-
-
-
Method Detail
-
newInstance
public static <V extends AbstractEntity & UpdatableEntity,M> FileMapKeycloakTransaction<V,M> newInstance(Class<V> entityClass, Function<String,Path> dataDirectoryFunc, Function<V,String[]> suggestedPath, boolean isExpirableEntity, Map<SearchableModelField<? super M>,MapModelCriteriaBuilder.UpdatePredicatesFunc<String,V,M>> fieldPredicates)
-
rollback
public void rollback()
- Specified by:
rollbackin interfaceKeycloakTransaction- Overrides:
rollbackin classConcurrentHashMapKeycloakTransaction<String,V extends AbstractEntity & UpdatableEntity,M>
-
commit
public void commit()
- Specified by:
commitin interfaceKeycloakTransaction- Overrides:
commitin classConcurrentHashMapKeycloakTransaction<String,V extends AbstractEntity & UpdatableEntity,M>
-
touch
public void touch(Path path) throws FileAlreadyExistsException, IOException
-
removeIfExists
public boolean removeIfExists(Path path)
-
registerEntityForChanges
public V registerEntityForChanges(V origEntity)
Description copied from class:ConcurrentHashMapKeycloakTransactionReturns a deep clone of an entity. If the clone is already in the transaction, returns this one.Usually used before giving an entity from a source back to the caller, to prevent changing it directly in the data store, but to keep transactional properties.
- Overrides:
registerEntityForChangesin classConcurrentHashMapKeycloakTransaction<String,V extends AbstractEntity & UpdatableEntity,M>- Parameters:
origEntity- Original entity- Returns:
-
-