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 TypeMethodDescriptionvoid
close()
Returns the value to which the specifiedkey
.loadOrCreate
(String key, Supplier<String> valueGenerator) Returns the value to which the specifiedkey
or, if not found, stores the value returned by thevalueGenerator
.void
Removes thevalue
specified by thekey
.void
Stores the specifiedvalue
with the specifiedkey
.
-
Constructor Details
-
JpaServerConfigStorageProvider
public JpaServerConfigStorageProvider(jakarta.persistence.EntityManager entityManager)
-
-
Method Details
-
find
Description copied from interface:ServerConfigStorageProvider
Returns the value to which the specifiedkey
.- Specified by:
find
in interfaceServerConfigStorageProvider
- Parameters:
key
- Thekey
whose associated value is to be returned.- Returns:
- The value from the specified
key
.
-
store
Description copied from interface:ServerConfigStorageProvider
Stores the specifiedvalue
with the specifiedkey
.If the
key
exists, its value is updated.- Specified by:
store
in interfaceServerConfigStorageProvider
- Parameters:
key
- Thekey
with which the specifiedvalue
is to be stored.value
- Thevalue
to be associated with the specifiedkey
.
-
remove
Description copied from interface:ServerConfigStorageProvider
Removes thevalue
specified by thekey
.- Specified by:
remove
in interfaceServerConfigStorageProvider
- Parameters:
key
- Thekey
whose value is to be removed.
-
loadOrCreate
Description copied from interface:ServerConfigStorageProvider
Returns the value to which the specifiedkey
or, if not found, stores the value returned by thevalueGenerator
.- Specified by:
loadOrCreate
in interfaceServerConfigStorageProvider
- Parameters:
key
- Thekey
whose associated value is to be returned or stored.valueGenerator
- TheSupplier
to generate the value if it is not found.- Returns:
- The {value stored by the
key
, or the value generated by theSupplier
.
-
close
public void close()
-