Interface ServerConfigStorageProvider

All Superinterfaces:
Provider
All Known Implementing Classes:
JpaServerConfigStorageProvider

public interface ServerConfigStorageProvider extends Provider
A Provider to store server configuration to be shared between the Keycloak instances.

This provider is a key-value store where both keys and values are String.

  • Method Summary

    Modifier and Type
    Method
    Description
    find(String key)
    Returns the value to which the specified key.
    loadOrCreate(String key, Supplier<String> valueGenerator)
    Returns the value to which the specified key or, if not found, stores the value returned by the valueGenerator.
    void
    Removes the value specified by the key.
    void
    store(String key, String value)
    Stores the specified value with the specified key.

    Methods inherited from interface org.keycloak.provider.Provider

    close
  • Method Details

    • find

      Optional<String> find(String key)
      Returns the value to which the specified key.
      Parameters:
      key - The key whose associated value is to be returned.
      Returns:
      The value from the specified key.
      Throws:
      NullPointerException - if the specified key is null.
    • store

      void store(String key, String value)
      Stores the specified value with the specified key.

      If the key exists, its value is updated.

      Parameters:
      key - The key with which the specified value is to be stored.
      value - The value to be associated with the specified key.
      Throws:
      NullPointerException - if the specified key or value is null.
    • remove

      void remove(String key)
      Removes the value specified by the key.
      Parameters:
      key - The key whose value is to be removed.
      Throws:
      NullPointerException - if the specified key is null.
    • loadOrCreate

      String loadOrCreate(String key, Supplier<String> valueGenerator)
      Returns the value to which the specified key or, if not found, stores the value returned by the valueGenerator.
      Parameters:
      key - The key whose associated value is to be returned or stored.
      valueGenerator - The Supplier to generate the value if it is not found.
      Returns:
      The {value stored by the key, or the value generated by the Supplier.
      Throws:
      NullPointerException - if the specified key, valueGenerator or Supplier return value is null.