All the ActivationStrategy
of togglez uses input from HttpRequest or from other context.
However, If I am using togglez for stand alone java application is there any way to pass parameters into isActive
method.
Features.DOWNLOAD_ACCESS.isActive(availableBalance);
instead of
Features.DOWNLOAD_ACCESS.isActive();
Below is ReleaseDateActivationStrategy
uses current date. But if some one change system date than it will fail.
https://github.com/togglz/togglz/blob/master/core/src/main/java/org/togglz/core/activation/ReleaseDateActivationStrategy.java
ActivationStrategies in Togglz have an IsActive method take two parameters, the FeatureState and a FeatureUser. These are supplied by a StateRepository implementation and a UserProvider implementation respectively. If you want to have that level of customization in stand alone applications you should provide and implement a custom FeatureManagerProvider which provides the feature manager as described in the Togglz advanced config. You create a custom StateRepository and UserProvider as well.