Class BootstrapFeatureManager

java.lang.Object
com.atlassian.jira.config.feature.BootstrapFeatureManager
All Implemented Interfaces:
FeatureManager

public class BootstrapFeatureManager extends Object implements FeatureManager
Simple feature manager used during bootstrap. Setup does not use features at all currently.
Since:
v5.0
  • Constructor Details

    • BootstrapFeatureManager

      public BootstrapFeatureManager()
  • Method Details

    • isEnabled

      public boolean isEnabled(String featureKey)
      Description copied from interface: FeatureManager
      Checks whether feature featureKey is enabled either in the running JIRA instance or for the current user. If the featureKey relates to a feature flag that is defined, then it will also take the default values into consideration.
      Specified by:
      isEnabled in interface FeatureManager
      Parameters:
      featureKey - feature key
      Returns:
      true, if feature identified by featureKey is enabled, false otherwise
    • isEnabled

      public boolean isEnabled(Feature coreFeature)
      Description copied from interface: FeatureManager
      Checks whether or not the specified feature is enabled. This method should be prefered over FeatureManager.isEnabled(String) for internal feature checks, particularly for core features that are not user-settable, as it will skip loading the current user's preferences when possible.
      Specified by:
      isEnabled in interface FeatureManager
      Parameters:
      coreFeature - the feature to check
      Returns:
      true if feature is enabled; false otherwise
    • isEnabled

      public boolean isEnabled(FeatureFlag featureFlag)
      Description copied from interface: FeatureManager
      Checking the state of feature flag
      Specified by:
      isEnabled in interface FeatureManager
      Parameters:
      featureFlag - defined feature flag
      Returns:
      state of the feature flag
    • getFeatureFlag

      public io.atlassian.fugue.Option<FeatureFlag> getFeatureFlag(String featureKey)
      Description copied from interface: FeatureManager
      Return a feature flag by key
      Specified by:
      getFeatureFlag in interface FeatureManager
      Parameters:
      featureKey - the feature key string
      Returns:
      optional value of feature flag
    • isEnabled

      public boolean isEnabled(CoreFeatures coreFeature)
      Description copied from interface: FeatureManager
      Checks whether feature is enabled either in the running JIRA instance or for the current user. This method should be prefered over FeatureManager.isEnabled(String) for internal feature checks, particularly for core features that are not user-settable, as it will skip loading the current user's preferences when possible.
      Specified by:
      isEnabled in interface FeatureManager
      Parameters:
      coreFeature - the core feature to check
      Returns:
      true if feature is enabled; false otherwise
    • getEnabledFeatureKeys

      public Set<String> getEnabledFeatureKeys()
      Description copied from interface: FeatureManager
      Returns a set containing the feature keys of all features that are currently enabled.
      Specified by:
      getEnabledFeatureKeys in interface FeatureManager
      Returns:
      a set containing the feature keys of all features that are currently enabled
    • getDarkFeatures

      public DarkFeatures getDarkFeatures()
      Description copied from interface: FeatureManager
      Creates DarkFeatures instances from the PropertySet associated with the current user.
      Specified by:
      getDarkFeatures in interface FeatureManager
      Returns:
      Returns the Dark Features state for the current user.
    • getRegisteredFlags

      public Set<FeatureFlag> getRegisteredFlags()
      Specified by:
      getRegisteredFlags in interface FeatureManager
      Returns:
      a list of feature flags in the system
    • enableUserDarkFeature

      public void enableUserDarkFeature(ApplicationUser user, String feature)
      Description copied from interface: FeatureManager
      Enables a feature for a particular User. Raises a FeatureEnabledEvent.

      Since JIRA 5.1, this method raises a FeatureEnabledEvent if it is successful.

      Specified by:
      enableUserDarkFeature in interface FeatureManager
      Parameters:
      user - the user to enable the feature for
      feature - the feature to enable
    • disableUserDarkFeature

      public void disableUserDarkFeature(ApplicationUser user, String feature)
      Description copied from interface: FeatureManager
      Disables a feature for a particular user.

      Since JIRA 5.1, this method raises a FeatureDisabledEvent if it is successful.

      Specified by:
      disableUserDarkFeature in interface FeatureManager
      Parameters:
      user - the user to disable the feature for
      feature - the feature to disable
    • enableSiteDarkFeature

      public void enableSiteDarkFeature(String feature)
      Description copied from interface: FeatureManager
      Enables a site-wide feature.

      Since JIRA 5.1, this method raises a FeatureEnabledEvent if it is successful.

      Specified by:
      enableSiteDarkFeature in interface FeatureManager
      Parameters:
      feature - the feature to enable
    • disableSiteDarkFeature

      public void disableSiteDarkFeature(String feature)
      Description copied from interface: FeatureManager
      Disables a site-wide feature.

      Since JIRA 5.1, this method raises a FeatureDisabledEvent if it is successful.

      Specified by:
      disableSiteDarkFeature in interface FeatureManager
      Parameters:
      feature - the feature to disable
    • hasSiteEditPermission

      public boolean hasSiteEditPermission()
      Description copied from interface: FeatureManager
      Returns true if the currently logged in user has permission to edit site dark features.
      Specified by:
      hasSiteEditPermission in interface FeatureManager
      Returns:
      true if the currently logged in user has permission to edit site dark features.
    • getDarkFeaturesForUser

      public DarkFeatures getDarkFeaturesForUser(@Nullable ApplicationUser user)
      Specified by:
      getDarkFeaturesForUser in interface FeatureManager
      Parameters:
      user - the user being queried; null represents the anonymous user
      Returns:
      Returns the dark features state for the current user.
    • isEnabledForUser

      public boolean isEnabledForUser(ApplicationUser user, String featureKey)
      Description copied from interface: FeatureManager
      Checks whether a feature with given featureKey is enabled in the running JIRA instance for the given user.
      Specified by:
      isEnabledForUser in interface FeatureManager
      Parameters:
      user - the user being queried
      featureKey - feature key
      Returns:
      true, if feature identified by featureKey is enabled, false otherwise