Package org.togglz.core.repository
Interface StateRepository
-
- All Known Implementing Classes:
CachingStateRepository,CompositeStateRepository,FileBasedStateRepository,InMemoryStateRepository,JDBCStateRepository,ListenableStateRepository,LoggingStateRepository,PropertyBasedStateRepository
public interface StateRepositoryThis 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FeatureStategetFeatureState(Feature feature)Get the persisted state of a feature from the repository.voidsetFeatureState(FeatureState featureState)Persist the supplied feature state.
-
-
-
Method Detail
-
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 returnnull.- 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 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
-
-