Class FeatureFlagsFF4j

java.lang.Object
org.europa.together.application.FeatureFlagsFF4j
All Implemented Interfaces:
FeatureFlags

@Repository public class FeatureFlagsFF4j extends Object implements FeatureFlags
Implementation of feature toggels.
  • 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 interface FeatureFlags
      Parameters:
      propertyFile - as String
      Returns:
      feature store as FF4j
      Throws:
      IOException
      ConnectException
      MisconfigurationException
    • check

      public boolean check(String featureId)
      Description copied from interface: FeatureFlags
      Check if a feature is enbaled or not.
      Specified by:
      check in interface FeatureFlags
      Parameters:
      featureId - as String
      Returns:
      check as boolean
    • activateFeature

      public void activateFeature(String featureId)
      Description copied from interface: FeatureFlags
      Activate a feature in the feature store by given ID.
      Specified by:
      activateFeature in interface FeatureFlags
      Parameters:
      featureId - as String
    • deactivateFeature

      public void deactivateFeature(String featureId)
      Description copied from interface: FeatureFlags
      Deactivate a feature in the feature store by given ID.
      Specified by:
      deactivateFeature in interface FeatureFlags
      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 interface FeatureFlags
      Parameters:
      feature - as Feature
    • getFeature

      public org.ff4j.core.Feature getFeature(String featureId)
      Description copied from interface: FeatureFlags
      Get the full feature by a given ID from the feature store.
      Specified by:
      getFeature in interface FeatureFlags
      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 interface FeatureFlags
      Parameters:
      feature - as Feature
    • removeFeature

      public void removeFeature(String featureId)
      Description copied from interface: FeatureFlags
      Remove an existing feature from the feature store.
      Specified by:
      removeFeature in interface FeatureFlags
    • listAllFeatures

      public Map<String,org.ff4j.core.Feature> listAllFeatures()
      Description copied from interface: FeatureFlags
      Grab all in the feature store existing features.
      Specified by:
      listAllFeatures in interface FeatureFlags
      Returns:
      Feature by its featureId as Map