com.atlassian.bamboo
Class DefaultDarkFeatureService

java.lang.Object
  extended by com.atlassian.bamboo.DefaultDarkFeatureService
All Implemented Interfaces:
DarkFeatureService

public class DefaultDarkFeatureService
extends Object
implements DarkFeatureService

Facade for DarkFeatureManager and FeatureManager

Since:
5.9

Constructor Summary
DefaultDarkFeatureService()
           
 
Method Summary
 void disableFeatureForCurrentUser(String featureKey)
          Disable a given feature for the current user.
 void disableFeatureForUser(String featureKey, com.atlassian.user.User user)
          Disable a given feature for a given user.
 void enableFeatureForCurrentUser(String featureKey)
          Enable a given feature for the current user.
 void enableFeatureForUser(String featureKey, com.atlassian.user.User user)
          Enable a given feature for a given user.
 boolean isArtifactStorageConfigurationEnabled()
          Check whether the artifact storage configuration is enabled.
 boolean isArtifactStorageSpaceLimited()
          Whether server-side artifact storage space is limited according to AdministrationConfiguration.getStorageLimit() storage limits.
 boolean isExperimentalRestAdminApiEnabled()
          Check whether the experimental REST admin API is enabled.
 boolean isFeatureForCurrentUserEnabled(String featureKey)
          Check whether a given feature key is enabled for the current user.
 boolean isFeatureForUserEnabled(String featureKey, com.atlassian.user.User user)
          Check whether a given feature key is enabled for a given user.
 boolean isSimplifiedPlanConfigEnabled()
          Check whether the simplified plan configuration is enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDarkFeatureService

public DefaultDarkFeatureService()
Method Detail

isSimplifiedPlanConfigEnabled

public boolean isSimplifiedPlanConfigEnabled()
Description copied from interface: DarkFeatureService
Check whether the simplified plan configuration is enabled.

Specified by:
isSimplifiedPlanConfigEnabled in interface DarkFeatureService
Returns:
is the simplified plan configuration enabled.

isArtifactStorageConfigurationEnabled

public boolean isArtifactStorageConfigurationEnabled()
Description copied from interface: DarkFeatureService
Check whether the artifact storage configuration is enabled.

Specified by:
isArtifactStorageConfigurationEnabled in interface DarkFeatureService
Returns:
is the artifact storage configuration enabled.

isArtifactStorageSpaceLimited

public boolean isArtifactStorageSpaceLimited()
Description copied from interface: DarkFeatureService
Whether server-side artifact storage space is limited according to AdministrationConfiguration.getStorageLimit() storage limits.

Specified by:
isArtifactStorageSpaceLimited in interface DarkFeatureService

isExperimentalRestAdminApiEnabled

public boolean isExperimentalRestAdminApiEnabled()
Description copied from interface: DarkFeatureService
Check whether the experimental REST admin API is enabled.

Specified by:
isExperimentalRestAdminApiEnabled in interface DarkFeatureService
Returns:
whether the REST admin API is enabled.

enableFeatureForCurrentUser

public void enableFeatureForCurrentUser(String featureKey)
                                 throws IllegalArgumentException
Description copied from interface: DarkFeatureService
Enable a given feature for the current user.

Specified by:
enableFeatureForCurrentUser in interface DarkFeatureService
Parameters:
featureKey - the feature key to be enabled.
Throws:
IllegalArgumentException - if the current user is not logged in.

enableFeatureForUser

public void enableFeatureForUser(String featureKey,
                                 @NotNull
                                 com.atlassian.user.User user)
                          throws org.acegisecurity.AccessDeniedException
Description copied from interface: DarkFeatureService
Enable a given feature for a given user.

Specified by:
enableFeatureForUser in interface DarkFeatureService
Parameters:
featureKey - the feature key to be enabled.
user - the user for which the feature should be enabled.
Throws:
org.acegisecurity.AccessDeniedException - if the current user is not an admin.

disableFeatureForCurrentUser

public void disableFeatureForCurrentUser(String featureKey)
                                  throws IllegalArgumentException
Description copied from interface: DarkFeatureService
Disable a given feature for the current user.

Specified by:
disableFeatureForCurrentUser in interface DarkFeatureService
Parameters:
featureKey - the feature key to be enabled.
Throws:
IllegalArgumentException - if the current user is not logged in.

disableFeatureForUser

public void disableFeatureForUser(String featureKey,
                                  @NotNull
                                  com.atlassian.user.User user)
                           throws org.acegisecurity.AccessDeniedException
Description copied from interface: DarkFeatureService
Disable a given feature for a given user.

Specified by:
disableFeatureForUser in interface DarkFeatureService
Parameters:
featureKey - the feature key to be disabled.
user - the user for which the feature should be disabled.
Throws:
org.acegisecurity.AccessDeniedException - if the current user is not an admin.

isFeatureForUserEnabled

public boolean isFeatureForUserEnabled(String featureKey,
                                       @NotNull
                                       com.atlassian.user.User user)
Description copied from interface: DarkFeatureService
Check whether a given feature key is enabled for a given user. Apart from checking whether the feature is enabled for the given user, this will also check site-wide enabled features.

Specified by:
isFeatureForUserEnabled in interface DarkFeatureService
Parameters:
featureKey - the feature key
user - the user
Returns:
whether the feature key is enabled for the given user.

isFeatureForCurrentUserEnabled

public boolean isFeatureForCurrentUserEnabled(@NotNull
                                              String featureKey)
Description copied from interface: DarkFeatureService
Check whether a given feature key is enabled for the current user. Apart from checking whether the feature is enabled for the current user, this will also check site-wide enabled features.

Specified by:
isFeatureForCurrentUserEnabled in interface DarkFeatureService
Parameters:
featureKey - the feature key
Returns:
whether the feature key is enabled for the current user.


Copyright © 2015 Atlassian Software Systems Pty Ltd. All rights reserved.