public class

DefaultFeatureManager

extends Object
implements FeatureManager
java.lang.Object
   ↳ com.atlassian.jira.config.DefaultFeatureManager

Class Overview

Default implementation of FeatureManager.

Summary

Nested Classes
class DefaultFeatureManager.FeaturesMapHolder  
Constants
String FEATURE_RESOURCE_TYPE
[Expand]
Inherited Constants
From interface com.atlassian.jira.config.FeatureManager
Fields
public static final Resources.TypeFilter FEATURE_TYPE_FILTER
Public Constructors
DefaultFeatureManager(PluginAccessor pluginAccessor, EventPublisher eventPublisher, PermissionManager permissionManager, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, UserPreferencesManager userPreferencesManager)
Public Methods
void disableSiteDarkFeature(String feature)
Disables a site-wide feature.
void disableUserDarkFeature(User user, String feature)
Disables a feature for a particular user.
void enableSiteDarkFeature(String feature)
Enables a site-wide feature.
void enableUserDarkFeature(User user, String feature)
Enables a feature for a particular User.
DarkFeatures getDarkFeatures()
Creates DarkFeatures instances from the PropertySet associated with the ThreadLocal user.
Set<String> getEnabledFeatureKeys()
Returns a set containing the feature keys of all features that are currently enabled.
boolean hasSiteEditPermission()
Returns true if the currently logged in user has permission to edit site dark features.
boolean isEnabled(String featureKey)
Checks whether a feature with given featureKey is enabled in the running JIRA instance.
boolean isEnabled(CoreFeatures coreFeature)
Checks whether a feature with given coreFeature is enabled in the running JIRA instance.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.config.FeatureManager

Constants

public static final String FEATURE_RESOURCE_TYPE

Constant Value: "feature"

Fields

public static final Resources.TypeFilter FEATURE_TYPE_FILTER

Public Constructors

public DefaultFeatureManager (PluginAccessor pluginAccessor, EventPublisher eventPublisher, PermissionManager permissionManager, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, UserPreferencesManager userPreferencesManager)

Public Methods

public void disableSiteDarkFeature (String feature)

Disables a site-wide feature. Since JIRA 5.1, this method raises a FeatureDisabledEvent if it is successful.

Parameters
feature the feature to disable

public void disableUserDarkFeature (User user, String feature)

Disables a feature for a particular user.

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

Parameters
user the user to disable the feature for
feature the feature to disable

public void enableSiteDarkFeature (String feature)

Enables a site-wide feature.

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

Parameters
feature the feature to enable

public void enableUserDarkFeature (User user, String feature)

Enables a feature for a particular User. Raises a FeatureEnabledEvent.

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

Parameters
user the user to enable the feature for
feature the feature to enable

public DarkFeatures getDarkFeatures ()

Creates DarkFeatures instances from the PropertySet associated with the ThreadLocal user.

Returns
  • Returns the Dark Features state for the current user.

public Set<String> getEnabledFeatureKeys ()

Returns a set containing the feature keys of all features that are currently enabled.

Returns
  • a set containing the feature keys of all features that are currently enabled

public boolean hasSiteEditPermission ()

Returns true if the currently logged in user has permission to edit site dark features.

Returns
  • true if the currently logged in user has permission to edit site dark features.

public boolean isEnabled (String featureKey)

Checks whether a feature with given featureKey is enabled in the running JIRA instance.

Parameters
featureKey feature key
Returns
  • true, if feature identified by featureKey is enabled, false otherwise

public boolean isEnabled (CoreFeatures coreFeature)

Checks whether a feature with given coreFeature is enabled in the running JIRA instance.

Parameters
coreFeature core feature instance
Returns
  • true, if given core feature is enabled, false otherwise