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
-
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.
-
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
ConnectException
MisconfigurationException
-
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
-
-
listAllFeatures
Grab all in the feature store existing features.- Returns:
- Feature by its featureId as Map
-