Package org.togglz.core.activation
Class SystemPropertyActivationStrategy
java.lang.Object
org.togglz.core.activation.AbstractPropertyDrivenActivationStrategy
org.togglz.core.activation.SystemPropertyActivationStrategy
- All Implemented Interfaces:
ActivationStrategy
public class SystemPropertyActivationStrategy
extends AbstractPropertyDrivenActivationStrategy
implements ActivationStrategy
ActivationStrategy based on a key value pair system property. To activate, the value of the property must match
the string value, not case sensitive.
Created by Chris Kelley on 5/26/16.
-
Field Summary
FieldsFields inherited from class org.togglz.core.activation.AbstractPropertyDrivenActivationStrategy
PARAM_NAME, PARAM_PROPERTY_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()A unique id for this strategy.getName()A human readable name of the strategy.Returns the list of configuration parameter definitions for the strategy.protected Stringprotected StringgetPropertyValue(FeatureState featureState, FeatureUser user, String name) Returns the value of the property with the specifiednameon which to base the activation of the feature.Methods inherited from class org.togglz.core.activation.AbstractPropertyDrivenActivationStrategy
getPropertyName, isActive, isActiveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.togglz.core.spi.ActivationStrategy
isActive
-
Field Details
-
ID
- See Also:
-
PARAM_PROPERTY_NAME
- See Also:
-
-
Constructor Details
-
SystemPropertyActivationStrategy
public SystemPropertyActivationStrategy()
-
-
Method Details
-
getId
Description copied from interface:ActivationStrategyA unique id for this strategy. This id is used to persist the selected strategy in theStateRepository.- Specified by:
getIdin interfaceActivationStrategy
-
getName
Description copied from interface:ActivationStrategyA human readable name of the strategy. This name is used to in the admin console to represent the strategy.- Specified by:
getNamein interfaceActivationStrategy
-
getPropertyValue
Description copied from class:AbstractPropertyDrivenActivationStrategyReturns the value of the property with the specified
nameon which to base the activation of the feature.- Specified by:
getPropertyValuein classAbstractPropertyDrivenActivationStrategy- Parameters:
featureState- theFeatureStatewhich represents the current configuration of the featureuser- theuserfor which to decide whether the feature is active (may be null)name- the name of the property whose value is to be returned- Returns:
- The (raw) value of the property with the given
nameor null if none could be found.
-
getPropertyNameParam
- Overrides:
getPropertyNameParamin classAbstractPropertyDrivenActivationStrategy
-
getParameters
Description copied from interface:ActivationStrategyReturns the list of configuration parameter definitions for the strategy. Parameters are typically built using a
ParameterBuilderclass but users can also create custom implementations of theParameterinterface.Example:
public Parameter[] getParameters() { return new Parameter[] { ParameterBuilder.create("country").label("Country Code").matching("[A-Z]+") }; }- Specified by:
getParametersin interfaceActivationStrategy- Overrides:
getParametersin classAbstractPropertyDrivenActivationStrategy- See Also:
-