|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DarkFeatureManager
Provides a cross-product method for determining whether a dark feature is enabled.
Implementing products can back these checks with their own internal dark feature management system, but must
follow the enable and disable dark features on startup based on system properties and the contents of an optional
properties file. To avoid clashes with other system properties all features specified as system property must be
prefixed with ATLASSIAN_DARKFEATURE_PREFIX. The prefix is removed from the feature key
when it is processed later. Values must be either true or false. The location of the dark features property file can
be overridden with the DARKFEATURES_PROPERTIES_FILE_PROPERTY system property.
See SystemDarkFeatureInitializer in sal-core for an implementation.
| Field Summary | |
|---|---|
static String |
ATLASSIAN_DARKFEATURE_PREFIX
Prefix for all dark feature specified as system property. |
static String |
DARKFEATURES_PROPERTIES_FILE_PROPERTY
System property for overriding location of dark features property file. |
static String |
DARKFEATURES_PROPERTIES_FILE_PROPERTY_DEFAULT
Default properties file name. |
static String |
DISABLE_ALL_DARKFEATURES_PROPERTY
System property for disabling all dark features. |
| 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. |
| Field Detail |
|---|
static final String ATLASSIAN_DARKFEATURE_PREFIX
static final String DISABLE_ALL_DARKFEATURES_PROPERTY
static final String DARKFEATURES_PROPERTIES_FILE_PROPERTY
static final String DARKFEATURES_PROPERTIES_FILE_PROPERTY_DEFAULT
| Method Detail |
|---|
boolean isFeatureEnabledForAllUsers(String featureKey)
featureKey - key of the feature to be checked
true if the feature key is valid and enabled, false otherwiseValidFeatureKeyPredicateboolean isFeatureEnabledForCurrentUser(String featureKey)
featureKey - 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
boolean isFeatureEnabledForUser(@Nullable
UserKey userKey,
String featureKey)
userKey - 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.
IllegalArgumentException - if the user doesn't existValidFeatureKeyPredicateboolean canManageFeaturesForAllUsers()
true iff the current acting user has permission to change dark features for all users,
false otherwisevoid enableFeatureForAllUsers(String featureKey)
featureKey - key of the feature to be enabled
InvalidFeatureKeyException - if the feature key is not valid
MissingPermissionException - if the user has not the required permission
IllegalStateException - if the update failedValidFeatureKeyPredicate,
canManageFeaturesForAllUsers()void disableFeatureForAllUsers(String featureKey)
featureKey - key of the feature to be disabled
InvalidFeatureKeyException - if the feature key is not valid
MissingPermissionException - if the user has not the required permission
IllegalStateException - if the update failedValidFeatureKeyPredicate,
canManageFeaturesForAllUsers()void enableFeatureForCurrentUser(String featureKey)
featureKey - key of the feature to enable
InvalidFeatureKeyException - if the feature key is not valid
IllegalStateException - if the current user could not be resolved, is anonymous or the update failed due to
any other reasonValidFeatureKeyPredicate
void enableFeatureForUser(UserKey userKey,
String featureKey)
userKey - key of the user to enable the feature for; not nullfeatureKey - key of the feature to be enabled
IllegalArgumentException - if the user does not exist or is anonymous
InvalidFeatureKeyException - if the feature key is not valid
IllegalStateException - if the update failedValidFeatureKeyPredicatevoid disableFeatureForCurrentUser(String featureKey)
featureKey - key of the feature to be disabled
InvalidFeatureKeyException - if the feature key is not valid
IllegalStateException - if the current user could not be resolved, is anonymous or the update failed due to
any other reasonValidFeatureKeyPredicate
void disableFeatureForUser(UserKey userKey,
String featureKey)
userKey - key of the user to disable the feature for; not nullfeatureKey - key of the feature to be disabled
IllegalArgumentException - if the user does not exist or is anonymous
InvalidFeatureKeyException - if the feature key is not valid
IllegalStateException - if the update failedValidFeatureKeyPredicateEnabledDarkFeatures getFeaturesEnabledForAllUsers()
EnabledDarkFeatures getFeaturesEnabledForCurrentUser()
EnabledDarkFeatures getFeaturesEnabledForUser(@Nullable
UserKey userKey)
userKey - key of the user being queried; null represents the anonymous user
IllegalArgumentException - if the user doesn't exist
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||