View Javadoc
1   package com.atlassian.sal.api.features;
2   
3   import com.atlassian.annotations.PublicSpi;
4   import com.google.common.collect.ImmutableSet;
5   
6   /**
7    * Persist site wide dark feature keys. <strong>The storage part used by the default {@link DarkFeatureManager}
8    * implementation.</strong>
9    *
10   * @since 2.10
11   */
12  @PublicSpi
13  public interface SiteDarkFeaturesStorage {
14      /**
15       * Tells whether the given dark feature key is defined (exists, is known) site wide.
16       *
17       * @param featureKey the feature key to be checked; not blank, leading and trailing whitespaces are removed
18       * @return <code>true</code> if the site contains the given feature key, <code>false</code> otherwise
19       */
20      boolean contains(String featureKey);
21  
22      /**
23       * Enable the given dark feature key site wide.
24       *
25       * @param featureKey the feature key to be enabled; not blank, leading and trailing whitespaces are removed
26       */
27      void enable(String featureKey);
28  
29      /**
30       * Disable the given dark feature key site wide.
31       *
32       * @param featureKey the feature key to be disabled; not blank, leading and trailing whitespaces are removed
33       */
34      void disable(String featureKey);
35  
36      /**
37       * @return all enabled site wide dark feature keys.
38       */
39      ImmutableSet<String> getEnabledDarkFeatures();
40  }