Package org.europa.together.application
Class FeatureFlagsFF4j
java.lang.Object
org.europa.together.application.FeatureFlagsFF4j
- All Implemented Interfaces:
FeatureFlags
Implementation of feature toggels.
-
Field Summary
Fields inherited from interface org.europa.together.business.FeatureFlags
CONFIG_SET, CONFIG_VERSION, FEATURE_ID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactivateFeature(String featureId) Activate a feature in the feature store by given ID.voidaddFeature(org.ff4j.core.Feature feature) Add a feature to the feature store.booleanCheck if a feature is enbaled or not.voiddeactivateFeature(String featureId) Deactivate a feature in the feature store by given ID.org.ff4j.core.FeaturegetFeature(String featureId) Get the full feature by a given ID from the feature store.org.ff4j.FF4jgetFeatureStore(String propertyFile) Connect an application to a feature store by a given database connection file.
- jdbc.driverClassName
- jdbc.url
- jdbc.user
- jdbc.passwordGrab all in the feature store existing features.voidremoveFeature(String featureId) Remove an existing feature from the feature store.voidupdateFeature(org.ff4j.core.Feature feature) Update an existing feature in the feature store.
-
Constructor Details
-
FeatureFlagsFF4j
public FeatureFlagsFF4j()Constructor.
-
-
Method Details
-
getFeatureStore
public org.ff4j.FF4j getFeatureStore(String propertyFile) throws IOException, ConnectException, MisconfigurationException Description copied from interface:FeatureFlagsConnect an application to a feature store by a given database connection file.
- jdbc.driverClassName
- jdbc.url
- jdbc.user
- jdbc.password- Specified by:
getFeatureStorein interfaceFeatureFlags- Parameters:
propertyFile- as String- Returns:
- feature store as FF4j
- Throws:
IOException- case of errorConnectException- case of errorMisconfigurationException- case of error
-
check
Description copied from interface:FeatureFlagsCheck if a feature is enbaled or not.- Specified by:
checkin interfaceFeatureFlags- Parameters:
featureId- as String- Returns:
- check as boolean
-
activateFeature
Description copied from interface:FeatureFlagsActivate a feature in the feature store by given ID.- Specified by:
activateFeaturein interfaceFeatureFlags- Parameters:
featureId- as String
-
deactivateFeature
Description copied from interface:FeatureFlagsDeactivate a feature in the feature store by given ID.- Specified by:
deactivateFeaturein interfaceFeatureFlags- Parameters:
featureId- as String
-
addFeature
public void addFeature(org.ff4j.core.Feature feature) Description copied from interface:FeatureFlagsAdd a feature to the feature store.- Specified by:
addFeaturein interfaceFeatureFlags- Parameters:
feature- as Feature
-
getFeature
Description copied from interface:FeatureFlagsGet the full feature by a given ID from the feature store.- Specified by:
getFeaturein interfaceFeatureFlags- Parameters:
featureId- as String- Returns:
- feature as Feature
-
updateFeature
public void updateFeature(org.ff4j.core.Feature feature) Description copied from interface:FeatureFlagsUpdate an existing feature in the feature store.- Specified by:
updateFeaturein interfaceFeatureFlags- Parameters:
feature- as Feature
-
removeFeature
Description copied from interface:FeatureFlagsRemove an existing feature from the feature store.- Specified by:
removeFeaturein interfaceFeatureFlags- Parameters:
featureId- as String
-
listAllFeatures
Description copied from interface:FeatureFlagsGrab all in the feature store existing features.- Specified by:
listAllFeaturesin interfaceFeatureFlags- Returns:
- Feature by its featureId as Map
-