Interface StateRepository

All Known Implementing Classes:
CachingStateRepository, CompositeStateRepository, FileBasedStateRepository, InMemoryStateRepository, JDBCStateRepository, ListenableStateRepository, LoggingStateRepository, PropertyBasedStateRepository

public interface StateRepository
This interface defines the contract for a class that stores the feature state. Typical implementations are storing the state in a persistent way that works even across application restarts.
Author:
Christian Kaltepoth
  • Method Details

    • getFeatureState

      FeatureState getFeatureState(Feature feature)
      Get the persisted state of a feature from the repository. If the repository doesn't contain any information regarding this feature it must return null.
      Parameters:
      feature - The feature to read the state for
      Returns:
      The persisted feature state or null
    • setFeatureState

      void setFeatureState(FeatureState featureState)
      Persist the supplied feature state. The repository implementation must ensure that subsequent calls to getFeatureState(Feature) return the same state as persisted using this method.
      Parameters:
      featureState - The feature state to persist
      Throws:
      UnsupportedOperationException - if this state repository does not support updates