Class JpaServerConfigStorageProvider
java.lang.Object
org.keycloak.storage.configuration.jpa.JpaServerConfigStorageProvider
- All Implemented Interfaces:
Provider,ServerConfigStorageProvider
A
ServerConfigStorageProvider that stores its data in the database, using the EntityManager.-
Constructor Summary
ConstructorsConstructorDescriptionJpaServerConfigStorageProvider(jakarta.persistence.EntityManager entityManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Returns the value to which the specifiedkey.loadOrCreate(String key, Supplier<String> valueGenerator) Returns the value to which the specifiedkeyor, if not found, stores the value returned by thevalueGenerator.voidRemoves thevaluespecified by thekey.booleanvoidStores the specifiedvaluewith the specifiedkey.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.storage.configuration.ServerConfigStorageProvider
loadOrCreate, replace
-
Constructor Details
-
JpaServerConfigStorageProvider
public JpaServerConfigStorageProvider(jakarta.persistence.EntityManager entityManager)
-
-
Method Details
-
find
Description copied from interface:ServerConfigStorageProviderReturns the value to which the specifiedkey.- Specified by:
findin interfaceServerConfigStorageProvider- Parameters:
key- Thekeywhose associated value is to be returned.- Returns:
- The value from the specified
key.
-
store
Description copied from interface:ServerConfigStorageProviderStores the specifiedvaluewith the specifiedkey.If the
keyexists, its value is updated.- Specified by:
storein interfaceServerConfigStorageProvider- Parameters:
key- Thekeywith which the specifiedvalueis to be stored.value- Thevalueto be associated with the specifiedkey.
-
remove
Description copied from interface:ServerConfigStorageProviderRemoves thevaluespecified by thekey.- Specified by:
removein interfaceServerConfigStorageProvider- Parameters:
key- Thekeywhose value is to be removed.
-
loadOrCreate
Description copied from interface:ServerConfigStorageProviderReturns the value to which the specifiedkeyor, if not found, stores the value returned by thevalueGenerator.- Specified by:
loadOrCreatein interfaceServerConfigStorageProvider- Parameters:
key- Thekeywhose associated value is to be returned or stored.valueGenerator- TheSupplierto generate the value if it is not found.- Returns:
- The {value stored by the
key, or the value generated by theSupplier.
-
replace
public boolean replace(String key, Predicate<String> replacePredicate, Supplier<String> valueGenerator) Description copied from interface:ServerConfigStorageProvider- Specified by:
replacein interfaceServerConfigStorageProvider- Parameters:
key- Thekeywhose associated value is to be replaced.replacePredicate- ThePredicateto signal if the value should be replaced.valueGenerator- TheSupplierto generate the value if it is should be replaced.- Returns:
trueif the value is replaced, andfalseotherwise.
-
close
public void close()
-