Package org.togglz.core.manager
Class LazyResolvingFeatureManager
java.lang.Object
org.togglz.core.manager.LazyResolvingFeatureManager
- All Implemented Interfaces:
FeatureManager
A feature manager that delegates all calls to the manager obtained lazily via
FeatureContext.getFeatureManager().- Author:
- Christian Kaltepoth
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidProvides access to theActivationStrategylist known by the managerGet the current feature user.Provides access to all features the manager is responsible for.getFeatureState(Feature feature) Returns theFeatureStatefor the specified feature.getMetaData(Feature feature) Returns theFeatureMetaDatadescribing the supplied feature.getName()A unique name for this feature manager.booleanChecks whether the supplied feature is active or not.voidsetFeatureState(FeatureState state) Updates the state of a feature.
-
Constructor Details
-
LazyResolvingFeatureManager
public LazyResolvingFeatureManager()
-
-
Method Details
-
getName
Description copied from interface:FeatureManagerA unique name for this feature manager.- Specified by:
getNamein interfaceFeatureManager
-
getFeatures
Description copied from interface:FeatureManagerProvides access to all features the manager is responsible for.- Specified by:
getFeaturesin interfaceFeatureManager- Returns:
- Set of features, never
null
-
getMetaData
Description copied from interface:FeatureManagerReturns theFeatureMetaDatadescribing the supplied feature.- Specified by:
getMetaDatain interfaceFeatureManager- Parameters:
feature- The feature to get the metadata for- Returns:
- the metadata for the feature
-
isActive
Description copied from interface:FeatureManagerChecks whether the supplied feature is active or not. Please note that this method will internally use theUserProviderto obtain the currently acting user as it may be relevant if the feature is enabled only for specific set of users.- Specified by:
isActivein interfaceFeatureManager- Parameters:
feature- The feature to check- Returns:
trueif the feature is active,falseotherwise
-
getCurrentFeatureUser
Description copied from interface:FeatureManagerGet the current feature user. This method will internally use the configuredUserProviderto obtain the user.- Specified by:
getCurrentFeatureUserin interfaceFeatureManager- Returns:
- The current
FeatureUseror null if theUserProviderdidn't return any result.
-
getFeatureState
Description copied from interface:FeatureManagerReturns theFeatureStatefor the specified feature. This state represents the current configuration of the feature and is typically persisted by aStateRepositoryacross JVM restarts. The state includes whether the feature is enabled or disabled and the use list.- Specified by:
getFeatureStatein interfaceFeatureManager- Parameters:
feature- The feature to get the state for- Returns:
- The current state of the feature, never
null.
-
setFeatureState
Description copied from interface:FeatureManagerUpdates the state of a feature. THis allows to enable or disable a feature and to modify the user list associated with the feature.- Specified by:
setFeatureStatein interfaceFeatureManager- Parameters:
state- The new feature state.
-
getActivationStrategies
Description copied from interface:FeatureManagerProvides access to theActivationStrategylist known by the manager- Specified by:
getActivationStrategiesin interfaceFeatureManager- Returns:
- list of
ActivationStrategy
-
enable
- Specified by:
enablein interfaceFeatureManager
-
disable
- Specified by:
disablein interfaceFeatureManager
-