Search in sources :

Example 1 with FlippingStrategyBadRequestException

use of org.ff4j.services.exceptions.FlippingStrategyBadRequestException in project ff4j by ff4j.

the class FeatureServices method initFlippingStrategy.

private void initFlippingStrategy(FeatureApiBean featureApiBean, Feature feature) {
    FlippingStrategyApiBean flipApiBean = featureApiBean.getFlippingStrategy();
    if (null != flipApiBean) {
        try {
            Map<String, String> initParams = flipApiBean.getInitParams();
            feature.setFlippingStrategy(MappingUtil.instanceFlippingStrategy(featureApiBean.getUid(), flipApiBean.getType(), initParams));
        } catch (FeatureAccessException exception) {
            throw new FlippingStrategyBadRequestException(exception);
        }
    }
}
Also used : FlippingStrategyApiBean(org.ff4j.services.domain.FlippingStrategyApiBean) FeatureAccessException(org.ff4j.exception.FeatureAccessException) FlippingStrategyBadRequestException(org.ff4j.services.exceptions.FlippingStrategyBadRequestException)

Aggregations

FeatureAccessException (org.ff4j.exception.FeatureAccessException)1 FlippingStrategyApiBean (org.ff4j.services.domain.FlippingStrategyApiBean)1 FlippingStrategyBadRequestException (org.ff4j.services.exceptions.FlippingStrategyBadRequestException)1