public class DefaultDarkFeatureManager extends Object implements DarkFeatureManager
ATLASSIAN_DARKFEATURE_PREFIX, DARKFEATURES_PROPERTIES_FILE_PROPERTY, DARKFEATURES_PROPERTIES_FILE_PROPERTY_DEFAULT, DISABLE_ALL_DARKFEATURES_PROPERTY| Constructor and Description |
|---|
DefaultDarkFeatureManager(UserManager userManager,
SiteDarkFeaturesStorage siteDarkFeaturesStorage) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canManageFeaturesForAllUsers()
Returns true if the current acting user has permission to change dark features for all users.
|
void |
disableFeatureForAllUsers(String featureKey)
Disable the given dark feature for all users.
|
void |
disableFeatureForCurrentUser(String featureKey)
Disable a dark feature for the current user only.
|
void |
disableFeatureForUser(UserKey userKey,
String featureKey)
Disable a dark feature for the given user only.
|
void |
enableFeatureForAllUsers(String featureKey)
Enable the given dark feature all users.
|
void |
enableFeatureForCurrentUser(String featureKey)
Enable a dark feature for the current user only.
|
void |
enableFeatureForUser(UserKey userKey,
String featureKey)
Enable a dark feature for the given user only.
|
EnabledDarkFeatures |
getFeaturesEnabledForAllUsers() |
EnabledDarkFeatures |
getFeaturesEnabledForCurrentUser()
Return features enabled for the current user (must be called within the context of a request).
|
EnabledDarkFeatures |
getFeaturesEnabledForUser(UserKey userKey)
Return enabled features for a given user.
|
boolean |
isFeatureEnabledForAllUsers(String featureKey)
Checks if a dark feature is enabled for all users, regardless whether the feature can be changed during runtime
or not.
|
boolean |
isFeatureEnabledForCurrentUser(String featureKey)
Checks if a dark feature is enabled for all users or for the current user only (must be called within the context
of a request).
|
boolean |
isFeatureEnabledForUser(UserKey userKey,
String featureKey)
Checks if a dark feature is enabled for all users or just for the given user.
|
public DefaultDarkFeatureManager(UserManager userManager, SiteDarkFeaturesStorage siteDarkFeaturesStorage)
public boolean isFeatureEnabledForAllUsers(String featureKey)
DarkFeatureManagerisFeatureEnabledForAllUsers in interface DarkFeatureManagerfeatureKey - key of the feature to be checkedtrue if the feature key is valid and enabled, false otherwiseValidFeatureKeyPredicatepublic boolean isFeatureEnabledForCurrentUser(String featureKey)
DarkFeatureManagerisFeatureEnabledForCurrentUser in interface DarkFeatureManagerfeatureKey - key of the feature to be checkedtrue if the feature is valid and enabled, either for all users or the current user only;
false otherwise.ValidFeatureKeyPredicatepublic boolean isFeatureEnabledForUser(@Nullable UserKey userKey, String featureKey)
DarkFeatureManagerisFeatureEnabledForUser in interface DarkFeatureManageruserKey - the key of the user being queried; null represents the anonymous userfeatureKey - key of the feature to be checkedtrue if the feature key is valid and enabled, either for all users or the current user only;
false otherwise.ValidFeatureKeyPredicatepublic boolean canManageFeaturesForAllUsers()
DarkFeatureManagercanManageFeaturesForAllUsers in interface DarkFeatureManagertrue iff the current acting user has permission to change dark features for all users,
false otherwisepublic void enableFeatureForAllUsers(String featureKey)
DarkFeatureManagerenableFeatureForAllUsers in interface DarkFeatureManagerfeatureKey - key of the feature to be enabledValidFeatureKeyPredicate,
DarkFeatureManager.canManageFeaturesForAllUsers()public void disableFeatureForAllUsers(String featureKey)
DarkFeatureManagerdisableFeatureForAllUsers in interface DarkFeatureManagerfeatureKey - key of the feature to be disabledValidFeatureKeyPredicate,
DarkFeatureManager.canManageFeaturesForAllUsers()public void enableFeatureForCurrentUser(String featureKey)
DarkFeatureManagerenableFeatureForCurrentUser in interface DarkFeatureManagerfeatureKey - key of the feature to enableValidFeatureKeyPredicatepublic void enableFeatureForUser(UserKey userKey, String featureKey)
DarkFeatureManagerenableFeatureForUser in interface DarkFeatureManageruserKey - key of the user to enable the feature for; not nullfeatureKey - key of the feature to be enabledValidFeatureKeyPredicatepublic void disableFeatureForCurrentUser(String featureKey)
DarkFeatureManagerdisableFeatureForCurrentUser in interface DarkFeatureManagerfeatureKey - key of the feature to be disabledValidFeatureKeyPredicatepublic void disableFeatureForUser(UserKey userKey, String featureKey)
DarkFeatureManagerdisableFeatureForUser in interface DarkFeatureManageruserKey - key of the user to disable the feature for; not nullfeatureKey - key of the feature to be disabledValidFeatureKeyPredicatepublic EnabledDarkFeatures getFeaturesEnabledForAllUsers()
getFeaturesEnabledForAllUsers in interface DarkFeatureManagerpublic EnabledDarkFeatures getFeaturesEnabledForCurrentUser()
DarkFeatureManagergetFeaturesEnabledForCurrentUser in interface DarkFeatureManagerpublic EnabledDarkFeatures getFeaturesEnabledForUser(@Nullable UserKey userKey)
DarkFeatureManagergetFeaturesEnabledForUser in interface DarkFeatureManageruserKey - key of the user being queried; null represents the anonymous userCopyright © 2015 Atlassian. All rights reserved.