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 TypeMethodDescriptionvoid
activateFeature
(String featureId) Activate a feature in the feature store by given ID.void
addFeature
(org.ff4j.core.Feature feature) Add a feature to the feature store.boolean
Check if a feature is enbaled or not.void
deactivateFeature
(String featureId) Deactivate a feature in the feature store by given ID.org.ff4j.core.Feature
getFeature
(String featureId) Get the full feature by a given ID from the feature store.org.ff4j.FF4j
getFeatureStore
(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.void
removeFeature
(String featureId) Remove an existing feature from the feature store.void
updateFeature
(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:FeatureFlags
Connect an application to a feature store by a given database connection file.- jdbc.driverClassName
- jdbc.url
- jdbc.user
- jdbc.password
- Specified by:
getFeatureStore
in interfaceFeatureFlags
- Parameters:
propertyFile
- as String- Returns:
- feature store as FF4j
- Throws:
IOException
ConnectException
MisconfigurationException
-
check
Description copied from interface:FeatureFlags
Check if a feature is enbaled or not.- Specified by:
check
in interfaceFeatureFlags
- Parameters:
featureId
- as String- Returns:
- check as boolean
-
activateFeature
Description copied from interface:FeatureFlags
Activate a feature in the feature store by given ID.- Specified by:
activateFeature
in interfaceFeatureFlags
- Parameters:
featureId
- as String
-
deactivateFeature
Description copied from interface:FeatureFlags
Deactivate a feature in the feature store by given ID.- Specified by:
deactivateFeature
in interfaceFeatureFlags
- Parameters:
featureId
- as String
-
addFeature
public void addFeature(org.ff4j.core.Feature feature) Description copied from interface:FeatureFlags
Add a feature to the feature store.- Specified by:
addFeature
in interfaceFeatureFlags
- Parameters:
feature
- as Feature
-
getFeature
Description copied from interface:FeatureFlags
Get the full feature by a given ID from the feature store.- Specified by:
getFeature
in interfaceFeatureFlags
- Parameters:
featureId
- as String- Returns:
- feature as Feature
-
updateFeature
public void updateFeature(org.ff4j.core.Feature feature) Description copied from interface:FeatureFlags
Update an existing feature in the feature store.- Specified by:
updateFeature
in interfaceFeatureFlags
- Parameters:
feature
- as Feature
-
removeFeature
Description copied from interface:FeatureFlags
Remove an existing feature from the feature store.- Specified by:
removeFeature
in interfaceFeatureFlags
-
listAllFeatures
Description copied from interface:FeatureFlags
Grab all in the feature store existing features.- Specified by:
listAllFeatures
in interfaceFeatureFlags
- Returns:
- Feature by its featureId as Map
-