Interface KeyValueStateRepository<T>

  • Type Parameters:
    T - type of the state object stored in this repository
    All Known Implementing Classes:
    DefaultKeyValueStateRepository

    public interface KeyValueStateRepository<T>
    A key-value repository for the connector state.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T fetch​(String key)
      Fetches the state value stored under the provided key in this repository.
      void update​(String key, T value)
      Updates the provided state value, stored under the provided key, in this repository.
    • Method Detail

      • fetch

        T fetch​(String key)
        Fetches the state value stored under the provided key in this repository.
        Parameters:
        key - key associated with the state value
        Returns:
        object stored under the provided key in this repository
        Throws:
        KeyNotFoundException - if no object under provided key exists in this repository
      • update

        void update​(String key,
                    T value)
        Updates the provided state value, stored under the provided key, in this repository.

        If no value is currently stored under the provided key - it will be inserted into this repository.

        Parameters:
        key - key associated with the state value
        value - state value