|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UserService
Service methods for performing operations on user accounts.
UserIndex
,
User
,
UserBean
Method Summary | |
---|---|
UserIndex |
addUserIndexToUser(User user,
UserIndexKey key,
String credentials)
Add a UserIndex with the specified id and credentials to an
existing user, returning the new index. |
void |
clearPhoneNumberRegistration(UserIndexKey userIndexKey)
Reset a previous call to registerPhoneNumber(User, String) for the
specified user |
UserIndex |
completePhoneNumberRegistration(UserIndex userIndex,
String registrationCode)
Complete phone number registration. |
void |
deleteStaleUsers()
Deletes stale users from the system. |
void |
deleteUser(User user)
Delete the specified user. |
void |
disableAdminRoleForUser(User user,
boolean onlyIfOtherAdmins)
Remove the admin role for a User. |
void |
enableAdminRoleForUser(User user,
boolean onlyIfNoOtherAdmins)
Enable the admin role for a User. |
List<Integer> |
getAllUserIds()
|
List<Integer> |
getAllUserIdsInRange(int offset,
int limit)
|
UserBean |
getAnonymousUser()
|
Long |
getMinApiRequestIntervalForKey(String key,
boolean forceRefresh)
|
int |
getNumberOfAdmins()
|
int |
getNumberOfUsers()
|
UserIndex |
getOrCreateUserForIndexKey(UserIndexKey key,
String credentials,
boolean isAnonymous)
|
UserIndex |
getOrCreateUserForUsernameAndPassword(String username,
String password)
|
UserBean |
getUserAsBean(User user)
|
User |
getUserForId(int userId)
|
UserIndex |
getUserIndexForId(UserIndexKey key)
|
List<String> |
getUserIndexKeyValuesForKeyType(String keyType)
|
UserPropertiesMigrationStatus |
getUserPropertiesMigrationStatus()
See UserPropertiesMigration |
boolean |
hasPhoneNumberRegistration(UserIndexKey userIndexKey)
|
boolean |
isAdministrator(User user)
Is the specified user an administrator? See the discussion in StandardAuthoritiesService |
boolean |
isAnonymous(User user)
Is the specified user anonymous? See the discussion in StandardAuthoritiesService |
void |
mergeUsers(User sourceUser,
User targetUser)
Given two user accounts, merge the two users into one. |
String |
registerPhoneNumber(User user,
String phoneNumber)
Begin phone number registration for the specified user. |
void |
removeUserIndexForUser(User user,
UserIndexKey key)
Remove the UserIndex with the specified id from the user. |
void |
resetUser(User user)
Reset all properties for the specified user to default values. |
void |
setCredentialsForUserIndex(UserIndex userIndex,
String credentials)
Update the credentials for the specified user index |
void |
setPasswordForUsernameUserIndex(UserIndex userIndex,
String password)
Update the password for the UserIndexTypes.USERNAME user index |
void |
startUserPropertiesMigration()
Start the user property migration task - see UserPropertiesMigration |
Method Detail |
---|
int getNumberOfUsers()
List<Integer> getAllUserIds()
List<Integer> getAllUserIdsInRange(int offset, int limit)
offset
- index offset into the full user id listlimit
- length of subset of the user id list to return
User getUserForId(int userId)
userId
- see User.getId()
int getNumberOfAdmins()
List<String> getUserIndexKeyValuesForKeyType(String keyType)
UserIndex getUserIndexForId(UserIndexKey key)
key
- see UserIndex.getId()
UserIndex getOrCreateUserForIndexKey(UserIndexKey key, String credentials, boolean isAnonymous)
key
- see UserIndex.getId()
credentials
- UserIndex.getCredentials()
isAnonymous
- is a newly created user anonymous -
User.getRoles()
UserIndex getOrCreateUserForUsernameAndPassword(String username, String password)
username
- password
-
UserIndex addUserIndexToUser(User user, UserIndexKey key, String credentials)
UserIndex
with the specified id and credentials to an
existing user, returning the new index. If an index with the specified id
already exists, it is returned instead.
user
- the target userkey
- see UserIndex.getId()
credentials
- see UserIndex.getCredentials()
void removeUserIndexForUser(User user, UserIndexKey key)
UserIndex
with the specified id from the user.
user
- key
- see UserIndex.getId()
void setCredentialsForUserIndex(UserIndex userIndex, String credentials)
userIndex
- credentials
- void setPasswordForUsernameUserIndex(UserIndex userIndex, String password)
UserIndexTypes.USERNAME
user index
userIndex
- password
- UserBean getUserAsBean(User user)
user
-
UserBean getAnonymousUser()
void deleteUser(User user)
UserIndex
objects
pointing to that user as well.
user
- void resetUser(User user)
user
- boolean isAnonymous(User user)
StandardAuthoritiesService
user
-
boolean isAdministrator(User user)
StandardAuthoritiesService
user
-
void enableAdminRoleForUser(User user, boolean onlyIfNoOtherAdmins)
user
- the user to mark as an adminonlyIfNoOtherAdmins
- when true, will only add the admin role if no
other users are marked as adminvoid disableAdminRoleForUser(User user, boolean onlyIfOtherAdmins)
user
- onlyIfOtherAdmins
- when true, will only remove the admin role if at
least one other user is marked as adminvoid mergeUsers(User sourceUser, User targetUser)
sourceUser
- this user will be deletedtargetUser
- this user will be updated and keptvoid startUserPropertiesMigration()
UserPropertiesMigration
UserPropertiesMigrationStatus getUserPropertiesMigrationStatus()
UserPropertiesMigration
String registerPhoneNumber(User user, String phoneNumber)
completePhoneNumberRegistration(UserIndex, String)
to verify that
they do in fact own that phone number.
user
- phoneNumber
-
completePhoneNumberRegistration(UserIndex, String)
boolean hasPhoneNumberRegistration(UserIndexKey userIndexKey)
userIndexKey
-
UserIndex completePhoneNumberRegistration(UserIndex userIndex, String registrationCode)
registerPhoneNumber(User, String)
,
then registration is completed by creating a new UserIndex
with
type UserIndexTypes.PHONE_NUMBER
with the phone number specified in
the previous call to register phone number.
userIndex
- registrationCode
-
UserIndex
object for the phone number
user indexvoid clearPhoneNumberRegistration(UserIndexKey userIndexKey)
registerPhoneNumber(User, String)
for the
specified user
userIndexKey
- Long getMinApiRequestIntervalForKey(String key, boolean forceRefresh)
key
- an API keyforceRefresh
- guarantees that supplied value has not been cached
void deleteStaleUsers()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |