Package org.togglz.spring.activation
Class SpringProfileActivationStrategy
- java.lang.Object
-
- org.togglz.core.activation.AbstractTokenizedActivationStrategy
-
- org.togglz.spring.activation.SpringProfileActivationStrategy
-
- All Implemented Interfaces:
ActivationStrategy
public class SpringProfileActivationStrategy extends AbstractTokenizedActivationStrategy
An activation strategy based on the profiles that are active within the Spring environment.
One or more profiles can be specified in a comma-separated value via the ""profiles"" parameter. This strategy works by only activating the feature if at least one of the profiles are currently active. Profile names are not case sensitive.
If a given profile is prefixed with the NOT operator (
!), the feature will only be active if the profile is not active. If the value of the ""profiles"" parameter was"p1,!p2", the feature would only be active if "p1" is active or if "p2" is not active.- Author:
- Alasdair Mercer
- See Also:
AbstractTokenizedActivationStrategy
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.togglz.core.activation.AbstractTokenizedActivationStrategy
AbstractTokenizedActivationStrategy.Token, AbstractTokenizedActivationStrategy.TokenTransformer
-
-
Field Summary
Fields Modifier and Type Field Description static StringIDstatic StringPARAM_PROFILES
-
Constructor Summary
Constructors Constructor Description SpringProfileActivationStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetId()StringgetName()Parameter[]getParameters()StringgetTokenParameterName()AbstractTokenizedActivationStrategy.TokenTransformergetTokenParameterTransformer()booleanisActive(FeatureState featureState, FeatureUser user, List<AbstractTokenizedActivationStrategy.Token> tokens)-
Methods inherited from class org.togglz.core.activation.AbstractTokenizedActivationStrategy
isActive, tokenize
-
-
-
-
Field Detail
-
ID
public static final String ID
- See Also:
- Constant Field Values
-
PARAM_PROFILES
public static final String PARAM_PROFILES
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public String getId()
-
getName
public String getName()
-
isActive
public boolean isActive(FeatureState featureState, FeatureUser user, List<AbstractTokenizedActivationStrategy.Token> tokens)
- Specified by:
isActivein classAbstractTokenizedActivationStrategy
-
getParameters
public Parameter[] getParameters()
-
getTokenParameterName
public String getTokenParameterName()
- Specified by:
getTokenParameterNamein classAbstractTokenizedActivationStrategy
-
getTokenParameterTransformer
public AbstractTokenizedActivationStrategy.TokenTransformer getTokenParameterTransformer()
- Overrides:
getTokenParameterTransformerin classAbstractTokenizedActivationStrategy
-
-