com.atlassian.jira.mock
Class MockFeatureManager

java.lang.Object
  extended by com.atlassian.jira.mock.MockFeatureManager
All Implemented Interfaces:
FeatureManager

public class MockFeatureManager
extends Object
implements FeatureManager


Field Summary
 
Fields inherited from interface com.atlassian.jira.config.FeatureManager
SYSTEM_PROPERTY_PREFIX
 
Constructor Summary
MockFeatureManager()
           
 
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)
          Disables a feature for a particular user.
 void enable(CoreFeatures coreFeature)
           
 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)
          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(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockFeatureManager

public MockFeatureManager()
Method Detail

isEnabled

public boolean isEnabled(String featureKey)
Description copied from interface: FeatureManager
Checks whether a feature with given featureKey is enabled in the running JIRA instance.

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(CoreFeatures coreFeature)
Description copied from interface: FeatureManager
Checks whether a feature with given coreFeature is enabled in the running JIRA instance.

Specified by:
isEnabled in interface FeatureManager
Parameters:
coreFeature - core feature instance
Returns:
true, if given core feature is enabled, false otherwise

enable

public void enable(CoreFeatures coreFeature)

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 ThreadLocal user.

Specified by:
getDarkFeatures in interface FeatureManager
Returns:
Returns the Dark Features state for the current user.

enableUserDarkFeature

public void enableUserDarkFeature(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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

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.


Copyright © 2002-2013 Atlassian. All Rights Reserved.