public class DefaultFeatureManager extends Object implements FeatureManager
FeatureManager| Modifier and Type | Method and Description |
|---|---|
List<ActivationStrategy> |
getActivationStrategies()
Provides access to the
ActivationStrategy list known by the manager |
FeatureUser |
getCurrentFeatureUser()
Get the current feature user.
|
Set<Feature> |
getFeatures()
Provides access to all features the manager is responsible for.
|
FeatureState |
getFeatureState(Feature feature)
Returns the
FeatureState for the specified feature. |
FeatureMetaData |
getMetaData(Feature feature)
Returns the
FeatureMetaData describing the supplied feature. |
String |
getName()
A unique name for this feature manager.
|
boolean |
isActive(Feature feature)
Checks whether the supplied feature is active or not.
|
void |
setFeatureState(FeatureState state)
Updates the state of a feature.
|
String |
toString() |
public String getName()
FeatureManagergetName in interface FeatureManagerpublic Set<Feature> getFeatures()
FeatureManagergetFeatures in interface FeatureManagernullpublic FeatureMetaData getMetaData(Feature feature)
FeatureManagerFeatureMetaData describing the supplied feature.getMetaData in interface FeatureManagerfeature - The feature to get the metadata forpublic boolean isActive(Feature feature)
FeatureManagerUserProvider to obtain the currently acting user as it may be relevant if the feature is enabled only for
specific set of users.isActive in interface FeatureManagerfeature - The feature to checktrue if the feature is active, false otherwisepublic FeatureState getFeatureState(Feature feature)
FeatureManagerFeatureState for the specified feature. This state represents the current configuration of the
feature and is typically persisted by a StateRepository across JVM restarts. The state includes whether
the feature is enabled or disabled and the use list.getFeatureState in interface FeatureManagerfeature - The feature to get the state fornull.public void setFeatureState(FeatureState state)
FeatureManagersetFeatureState in interface FeatureManagerstate - The new feature state.public List<ActivationStrategy> getActivationStrategies()
FeatureManagerActivationStrategy list known by the managergetActivationStrategies in interface FeatureManagerActivationStrategypublic FeatureUser getCurrentFeatureUser()
FeatureManagerUserProvider to obtain the
user.getCurrentFeatureUser in interface FeatureManagerFeatureUser or null if the UserProvider didn't return any result.Copyright © 2018. All Rights Reserved.