|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.sal.core.features.DefaultDarkFeatureManager
public class DefaultDarkFeatureManager
Default implementation of DarkFeatureManager - sufficient for any product which does not already have its own dark feature framework. Does not implement per-user enabling.
| Field Summary |
|---|
| Fields inherited from interface com.atlassian.sal.api.features.DarkFeatureManager |
|---|
ATLASSIAN_DARKFEATURE_PREFIX, DARKFEATURES_PROPERTIES_FILE_PROPERTY, DARKFEATURES_PROPERTIES_FILE_PROPERTY_DEFAULT, DISABLE_ALL_DARKFEATURES_PROPERTY |
| Constructor Summary | |
|---|---|
DefaultDarkFeatureManager(UserManager userManager,
SiteDarkFeaturesStorage siteDarkFeaturesStorage)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultDarkFeatureManager(UserManager userManager,
SiteDarkFeaturesStorage siteDarkFeaturesStorage)
| Method Detail |
|---|
public boolean isFeatureEnabledForAllUsers(String featureKey)
DarkFeatureManager
isFeatureEnabledForAllUsers in interface DarkFeatureManagerfeatureKey - key of the feature to be checked
true if the feature key is valid and enabled, false otherwiseValidFeatureKeyPredicatepublic boolean isFeatureEnabledForCurrentUser(String featureKey)
DarkFeatureManager
isFeatureEnabledForCurrentUser in interface DarkFeatureManagerfeatureKey - key of the feature to be checked
true if the feature is valid and enabled, either for all users or the current user only;
false otherwise.ValidFeatureKeyPredicate
public boolean isFeatureEnabledForUser(@Nullable
UserKey userKey,
String featureKey)
DarkFeatureManager
isFeatureEnabledForUser in interface DarkFeatureManageruserKey - the key of the user being queried; null represents the anonymous userfeatureKey - key of the feature to be checked
true if the feature key is valid and enabled, either for all users or the current user only;
false otherwise.ValidFeatureKeyPredicatepublic boolean canManageFeaturesForAllUsers()
DarkFeatureManager
canManageFeaturesForAllUsers in interface DarkFeatureManagertrue iff the current acting user has permission to change dark features for all users,
false otherwisepublic void enableFeatureForAllUsers(String featureKey)
DarkFeatureManager
enableFeatureForAllUsers in interface DarkFeatureManagerfeatureKey - key of the feature to be enabledValidFeatureKeyPredicate,
DarkFeatureManager.canManageFeaturesForAllUsers()public void disableFeatureForAllUsers(String featureKey)
DarkFeatureManager
disableFeatureForAllUsers in interface DarkFeatureManagerfeatureKey - key of the feature to be disabledValidFeatureKeyPredicate,
DarkFeatureManager.canManageFeaturesForAllUsers()public void enableFeatureForCurrentUser(String featureKey)
DarkFeatureManager
enableFeatureForCurrentUser in interface DarkFeatureManagerfeatureKey - key of the feature to enableValidFeatureKeyPredicate
public void enableFeatureForUser(UserKey userKey,
String featureKey)
DarkFeatureManager
enableFeatureForUser 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)
DarkFeatureManager
disableFeatureForCurrentUser in interface DarkFeatureManagerfeatureKey - key of the feature to be disabledValidFeatureKeyPredicate
public void disableFeatureForUser(UserKey userKey,
String featureKey)
DarkFeatureManager
disableFeatureForUser 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()
DarkFeatureManager
getFeaturesEnabledForCurrentUser in interface DarkFeatureManager
public EnabledDarkFeatures getFeaturesEnabledForUser(@Nullable
UserKey userKey)
DarkFeatureManager
getFeaturesEnabledForUser in interface DarkFeatureManageruserKey - key of the user being queried; null represents the anonymous user
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||