com.atlassian.jira.config
Interface FeatureManager

All Known Implementing Classes:
BootstrapFeatureManager, DefaultFeatureManager, MockFeatureManager

@PublicApi
public interface FeatureManager

Component responsible for providing information whether certain features in JIRA are enabled or disabled.

Since:
v4.4

Field Summary
static String SYSTEM_PROPERTY_PREFIX
          The prefix used for enabling dark features from the command line.
 
Method Summary
 void disableSiteDarkFeature(String feature)
          Disables a site-wide feature.
 void disableUserDarkFeature(ApplicationUser user, String feature)
          Disables a feature for a particular user.
 void disableUserDarkFeature(com.atlassian.crowd.embedded.api.User user, String feature)
          Deprecated. Use disableUserDarkFeature(com.atlassian.jira.user.ApplicationUser, String feature) instead. Since v6.0.
 void enableSiteDarkFeature(String feature)
          Enables a site-wide feature.
 void enableUserDarkFeature(ApplicationUser user, String feature)
          Enables a feature for a particular User.
 void enableUserDarkFeature(com.atlassian.crowd.embedded.api.User user, String feature)
          Deprecated. Use enableUserDarkFeature(com.atlassian.jira.user.ApplicationUser, String feature) instead. Since v6.0.
 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(CoreFeatures coreFeature)
          Checks whether a feature with given coreFeature is enabled in the running JIRA instance.
 boolean isEnabled(String featureKey)
          Checks whether a feature with given featureKey is enabled in the running JIRA instance.
 

Field Detail

SYSTEM_PROPERTY_PREFIX

static final String SYSTEM_PROPERTY_PREFIX
The prefix used for enabling dark features from the command line. For example, one might use -Datlassian.darkfeature.com.atlassian.jira.config.FAST_TABS=true as a JVM argument in order to enable fast tabs.

See Also:
Constant Field Values
Method Detail

isEnabled

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

isEnabled

@Internal
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

getEnabledFeatureKeys

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
Since:
v5.0

getDarkFeatures

DarkFeatures getDarkFeatures()
Creates DarkFeatures instances from the PropertySet associated with the ThreadLocal user.

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

enableUserDarkFeature

void enableUserDarkFeature(com.atlassian.crowd.embedded.api.User user,
                           String feature)
Deprecated. Use enableUserDarkFeature(com.atlassian.jira.user.ApplicationUser, String feature) instead. Since v6.0.

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

disableUserDarkFeature

void disableUserDarkFeature(com.atlassian.crowd.embedded.api.User user,
                            String feature)
Deprecated. Use disableUserDarkFeature(com.atlassian.jira.user.ApplicationUser, String feature) instead. Since v6.0.

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

enableUserDarkFeature

void enableUserDarkFeature(ApplicationUser 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

disableUserDarkFeature

void disableUserDarkFeature(ApplicationUser 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

enableSiteDarkFeature

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

disableSiteDarkFeature

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

hasSiteEditPermission

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.
Since:
5.2


Copyright © 2002-2013 Atlassian. All Rights Reserved.