|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UserSettingsService
Service for getting and updating immutable UserSettings objects stored against a user name
UserSettings can be used to store values of type String, Boolean and Long - nothing more.
Max key length is MAX_KEY_LENGTH
, Values of type String also have a max length of MAX_STRING_VALUE_LENGTH
Field Summary | |
---|---|
static int |
MAX_KEY_LENGTH
Key length is limited by DB constraints. |
static int |
MAX_STRING_VALUE_LENGTH
|
static String |
USER_SETTINGS_PREFIX
|
Method Summary | |
---|---|
UserSettings |
getUserSettings(String userName)
Deprecated. since 2.10, use getUserSettings(com.atlassian.sal.api.user.UserKey) instead |
UserSettings |
getUserSettings(UserKey userKey)
Gets the UserSettings for the given user. |
void |
updateUserSettings(String userName,
com.google.common.base.Function<UserSettingsBuilder,UserSettings> updateFunction)
Deprecated. since 2.10, use updateUserSettings(com.atlassian.sal.api.user.UserKey, com.google.common.base.Function) instead |
void |
updateUserSettings(UserKey userKey,
com.google.common.base.Function<UserSettingsBuilder,UserSettings> updateFunction)
Updates the UserSettings stored for this user. |
Field Detail |
---|
static final String USER_SETTINGS_PREFIX
static final int MAX_STRING_VALUE_LENGTH
static final int MAX_KEY_LENGTH
Method Detail |
---|
@Deprecated UserSettings getUserSettings(String userName)
getUserSettings(com.atlassian.sal.api.user.UserKey)
instead
userName
- name of the user whose user settings are to be retrieved
IllegalArgumentException
- if no user could be found with that nameUserSettings getUserSettings(UserKey userKey)
userKey
- key of a user whose user settings are to be retrieved
IllegalArgumentException
- if no user could be found with that name@Deprecated void updateUserSettings(String userName, com.google.common.base.Function<UserSettingsBuilder,UserSettings> updateFunction)
updateUserSettings(com.atlassian.sal.api.user.UserKey, com.google.common.base.Function)
instead
userName
- name of the user whose UserSettings are to be updated. If userName does not match a known user,
updateFunction will not be called.updateFunction
- function to update a user's UserSettings. The parameter to updateFunction is a
UserSettingsBuilder whose contents match the UserSettings for the provided user. The
return value of updateFunction will be stored against the specified user.
IllegalArgumentException
- if no user could be found with that name
UnsupportedOperationException
- if updateFunction creates entries with key length > MAX_KEY_LENGTH
or with a String value
with length > MAX_STRING_VALUE_LENGTH
void updateUserSettings(UserKey userKey, com.google.common.base.Function<UserSettingsBuilder,UserSettings> updateFunction)
userKey
- key of a user whose UserSettings are to be updated. If user is null or does not exist updateFunction will not be called.updateFunction
- function to update a user's UserSettings. The parameter to updateFunction is a
UserSettingsBuilder whose contents match the UserSettings for the provided user. The
return value of updateFunction will be stored against the specified user.
IllegalArgumentException
- if no user could be found with that name
UnsupportedOperationException
- if updateFunction creates entries with key length > MAX_KEY_LENGTH
or with a String value
with length > MAX_STRING_VALUE_LENGTH
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |