Class FileCrudOperations<V extends AbstractEntity & UpdatableEntity,M>
java.lang.Object
org.keycloak.models.map.storage.file.FileCrudOperations<V,M>
- All Implemented Interfaces:
HasRealmId,CrudOperations<V,M>
public abstract class FileCrudOperations<V extends AbstractEntity & UpdatableEntity,M>
extends Object
implements CrudOperations<V,M>, HasRealmId
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanParseFile(Path p) protected abstract voidcheckIsSafeToModify(Path path) Hook to validate that it is safe to modify the file identified by the suppliedPath.booleanlongdelete(QueryParameters<M> queryParameters) determineKeyFromValue(V value) Returns escaped ID - relative file name in the file system with path separatorID_COMPONENT_SEPARATOR.determineKeyFromValue(V value, String lastIdComponentIfUnset) longgetCount(QueryParameters<M> queryParameters) protected abstract FileTimegetLastModifiedTime(Path path) Hook to obtain the last modified time of the file identified by the suppliedPath.protected PathgetPathForEscapedId(String escapedId) protected PathgetPathForEscapedId(String[] escapedIdPathArray) static <V extends AbstractEntity & UpdatableEntity,M>
Map<org.keycloak.storage.SearchableModelField<? super M>,MapModelCriteriaBuilder.UpdatePredicatesFunc<String, V, M>> getPredicates(Class<V> entityClass) protected abstract StringgetTxId()protected Vread(QueryParameters<M> queryParameters) protected abstract voidregisterRenameOnCommit(Path tempSp, Path sp) protected abstract booleanremoveIfExists(Path sp) voidsetRealmId(String realmId) protected abstract voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.models.map.storage.CrudOperations
exists, exists
-
Field Details
-
SEARCHABLE_FIELD_REALM_ID_FIELD_NAME
-
FILE_SUFFIX
- See Also:
-
DUMP_SETTINGS
public static final org.snakeyaml.engine.v2.api.DumpSettings DUMP_SETTINGS -
ID_COMPONENT_SEPARATOR
- See Also:
-
-
Constructor Details
-
FileCrudOperations
-
-
Method Details
-
getPredicates
public static <V extends AbstractEntity & UpdatableEntity,M> Map<org.keycloak.storage.SearchableModelField<? super M>,MapModelCriteriaBuilder.UpdatePredicatesFunc<String, getPredicatesV, M>> (Class<V> entityClass) -
getPathForEscapedId
-
getPathForEscapedId
-
canParseFile
-
parse
-
create
- Specified by:
createin interfaceCrudOperations<V extends AbstractEntity & UpdatableEntity,M>
-
determineKeyFromValue
-
determineKeyFromValue
Returns escaped ID - relative file name in the file system with path separatorID_COMPONENT_SEPARATOR.- Specified by:
determineKeyFromValuein interfaceCrudOperations<V extends AbstractEntity & UpdatableEntity,M> - Parameters:
value- ObjectforCreate- Whether this is for create operation (true) or- Returns:
-
read
- Specified by:
readin interfaceCrudOperations<V extends AbstractEntity & UpdatableEntity,M>
-
createCriteriaBuilder
-
read
- Specified by:
readin interfaceCrudOperations<V extends AbstractEntity & UpdatableEntity,M>
-
update
- Specified by:
updatein interfaceCrudOperations<V extends AbstractEntity & UpdatableEntity,M>
-
delete
- Specified by:
deletein interfaceCrudOperations<V extends AbstractEntity & UpdatableEntity,M>
-
delete
- Specified by:
deletein interfaceCrudOperations<V extends AbstractEntity & UpdatableEntity,M>
-
getCount
- Specified by:
getCountin interfaceCrudOperations<V extends AbstractEntity & UpdatableEntity,M>
-
getRealmId
- Specified by:
getRealmIdin interfaceHasRealmId
-
setRealmId
- Specified by:
setRealmIdin interfaceHasRealmId
-
touch
- Throws:
IOException
-
removeIfExists
-
registerRenameOnCommit
-
getTxId
-
getLastModifiedTime
Hook to obtain the last modified time of the file identified by the suppliedPath. -
checkIsSafeToModify
Hook to validate that it is safe to modify the file identified by the suppliedPath. The primary goal is to identify if other transactions have modified the file after it was read by the current transaction, preventing updates to a stale entity.- Parameters:
path- thePathto the file that is to be modified.
-