public class

DefaultFeatureManager

extends Object
implements InitializingComponent FeatureManager Startable
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(JiraAuthenticationContext authenticationContext, FeatureStore featureStore, JiraProperties jiraSystemProperties, CacheManager cacheManager, TenantAccessor tenantAccessor)
Public Methods
void afterInstantiation()
void disableSiteDarkFeature(String feature)
Disables a site-wide feature.
@Deprecated void disableUserDarkFeature(User user, String feature)
Disables a feature for a particular user.
void disableUserDarkFeature(ApplicationUser user, String feature)
Disables a feature for a particular user.
void enableSiteDarkFeature(String feature)
Enables a site-wide feature.
void enableUserDarkFeature(ApplicationUser user, String feature)
Enables a feature for a particular User.
@Deprecated void enableUserDarkFeature(User user, String feature)
Enables a feature for a particular User.
DarkFeatures getDarkFeatures()
Creates DarkFeatures instances from the PropertySet associated with the current user.
DarkFeatures getDarkFeaturesForUser(ApplicationUser 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 feature featureKey is enabled either in the running JIRA instance or for the current user.
boolean isEnabled(Feature feature)
Checks whether or not the specified feature is enabled.
boolean isEnabled(CoreFeatures feature)
Checks whether feature is enabled either in the running JIRA instance or for the current user.
boolean isEnabledForUser(ApplicationUser user, String featureKey)
Checks whether a feature with given featureKey is enabled in the running JIRA instance for the given user.
boolean isOnDemand()
Convenience method equivalent to calling isEnabled(CoreFeatures.ON_DEMAND).
@EventListener void onClearCache(ClearCacheEvent event)
@EventListener void onTenantArrived(TenantArrivedEvent event)
void start()
This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.InitializingComponent
From interface com.atlassian.jira.config.FeatureManager
From interface com.atlassian.jira.extension.Startable

Constants

public static final String FEATURE_RESOURCE_TYPE

Constant Value: "feature"

Fields

public static final Resources.TypeFilter FEATURE_TYPE_FILTER

Public Constructors

public DefaultFeatureManager (JiraAuthenticationContext authenticationContext, FeatureStore featureStore, JiraProperties jiraSystemProperties, CacheManager cacheManager, TenantAccessor tenantAccessor)

Public Methods

public void afterInstantiation ()

Throws
Exception

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

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

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 (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

@Deprecated 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 current user.

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

public DarkFeatures getDarkFeaturesForUser (ApplicationUser 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 feature featureKey is enabled either in the running JIRA instance or for the current user.

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

public boolean isEnabled (Feature feature)

Checks whether or not the specified feature is enabled. This method should be prefered over 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.

Parameters
feature the feature to check
Returns
  • true if feature is enabled; false otherwise

public boolean isEnabled (CoreFeatures feature)

Checks whether feature is enabled either in the running JIRA instance or for the current user. This method should be prefered over 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.

Parameters
feature the core feature to check
Returns
  • true if feature is enabled; false otherwise

public boolean isEnabledForUser (ApplicationUser user, String featureKey)

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

Parameters
user the user being queried
featureKey feature key
Returns
  • true, if feature identified by featureKey is enabled, false otherwise

public boolean isOnDemand ()

Convenience method equivalent to calling isEnabled(CoreFeatures.ON_DEMAND).

Returns
  • true if this is JIRA OnDemand; false otherwise

@EventListener public void onClearCache (ClearCacheEvent event)

@EventListener public void onTenantArrived (TenantArrivedEvent event)

public void start ()

This method wil be called after the plugin system is fully initialised and all components added to the dependency injection framework.

Throws
Exception