Class FileMapStorage<V extends AbstractEntity & UpdatableEntity,M>
- java.lang.Object
-
- org.keycloak.models.map.storage.chm.ConcurrentHashMapStorage<String,V,M>
-
- org.keycloak.models.map.storage.file.FileMapStorage<V,M>
-
- All Implemented Interfaces:
KeycloakTransaction
,HasRealmId
,MapStorage<V,M>
public class FileMapStorage<V extends AbstractEntity & UpdatableEntity,M> extends ConcurrentHashMapStorage<String,V,M>
MapStorage
implementation used with the file map storage.- Author:
- Stefan Guilhen
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.keycloak.models.map.storage.chm.ConcurrentHashMapStorage
ConcurrentHashMapStorage.MapTaskWithValue
-
-
Field Summary
-
Fields inherited from class org.keycloak.models.map.storage.chm.ConcurrentHashMapStorage
active, cloner, fieldPredicates, keyConverter, map, realmIdEntityField, rollback, tasks
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commit()
static <V extends AbstractEntity & UpdatableEntity,M>
FileMapStorage<V,M>newInstance(Class<V> entityClass, Function<String,Path> dataDirectoryFunc, Function<V,String[]> suggestedPath, boolean isExpirableEntity)
V
registerEntityForChanges(V origEntity)
Returns a deep clone of an entity.boolean
removeIfExists(Path path)
void
rollback()
void
touch(Path path)
-
Methods inherited from class org.keycloak.models.map.storage.chm.ConcurrentHashMapStorage
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.MapStorage
exists
-
-
-
-
Method Detail
-
newInstance
public static <V extends AbstractEntity & UpdatableEntity,M> FileMapStorage<V,M> newInstance(Class<V> entityClass, Function<String,Path> dataDirectoryFunc, Function<V,String[]> suggestedPath, boolean isExpirableEntity)
-
rollback
public void rollback()
- Specified by:
rollback
in interfaceKeycloakTransaction
- Overrides:
rollback
in classConcurrentHashMapStorage<String,V extends AbstractEntity & UpdatableEntity,M>
-
commit
public void commit()
- Specified by:
commit
in interfaceKeycloakTransaction
- Overrides:
commit
in classConcurrentHashMapStorage<String,V extends AbstractEntity & UpdatableEntity,M>
-
touch
public void touch(Path path) throws IOException
- Throws:
IOException
-
removeIfExists
public boolean removeIfExists(Path path)
-
registerEntityForChanges
public V registerEntityForChanges(V origEntity)
Description copied from class:ConcurrentHashMapStorage
Returns 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:
registerEntityForChanges
in classConcurrentHashMapStorage<String,V extends AbstractEntity & UpdatableEntity,M>
- Parameters:
origEntity
- Original entity- Returns:
-
-