Package org.europa.together.business
Interface FeatureFlags
- All Known Implementing Classes:
FeatureFlagsFF4j
@API(status=STABLE,
since="3.0",
consumers="FeatureFlagsFF4j")
@Component
public interface FeatureFlags
Feature Flags is a wrapper for the FF4j library to enable toggels for
activating and deactivating features.
- Since:
- 1.0
- Version:
- 1.0
- Author:
- elmar.dott@gmail.com
-
Field Summary
Fields -
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.
-
Field Details
-
FEATURE_ID
Identifier for the given feature.- See Also:
-
CONFIG_SET
Define the configuration set for FeatureFlags.- See Also:
-
CONFIG_VERSION
Defines for which MODULE_VERSION the configuration will work.- See Also:
-
-
Method Details
-
getFeatureStore
org.ff4j.FF4j getFeatureStore(String propertyFile) throws IOException, ConnectException, MisconfigurationException Connect an application to a feature store by a given database connection file.
- jdbc.driverClassName
- jdbc.url
- jdbc.user
- jdbc.password- Parameters:
propertyFile- as String- Returns:
- feature store as FF4j
- Throws:
IOException- case of errorConnectException- case of errorMisconfigurationException- case of error
-
check
Check if a feature is enbaled or not.- Parameters:
featureId- as String- Returns:
- check as boolean
-
activateFeature
Activate a feature in the feature store by given ID.- Parameters:
featureId- as String
-
deactivateFeature
Deactivate a feature in the feature store by given ID.- Parameters:
featureId- as String
-
addFeature
void addFeature(org.ff4j.core.Feature feature) Add a feature to the feature store.- Parameters:
feature- as Feature
-
getFeature
Get the full feature by a given ID from the feature store.- Parameters:
featureId- as String- Returns:
- feature as Feature
-
updateFeature
void updateFeature(org.ff4j.core.Feature feature) Update an existing feature in the feature store.- Parameters:
feature- as Feature
-
removeFeature
Remove an existing feature from the feature store.- Parameters:
featureId- as String
-
listAllFeatures
Grab all in the feature store existing features.- Returns:
- Feature by its featureId as Map
-