Package org.togglz.core.repository
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 Summary
Modifier and TypeMethodDescriptiongetFeatureState(Feature feature) Get the persisted state of a feature from the repository.voidsetFeatureState(FeatureState featureState) Persist the supplied feature state.
-
Method Details
-
getFeatureState
Get the persisted state of a feature from the repository. If the repository doesn't contain any information regarding this feature it must returnnull.- Parameters:
feature- The feature to read the state for- Returns:
- The persisted feature state or
null
-
setFeatureState
Persist the supplied feature state. The repository implementation must ensure that subsequent calls togetFeatureState(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
-