public interface UserDataService
UserData
storage. All UserData
returned from and persisted
with this service will be testrun-specific. The testrun-identifier is set in the constructor.Modifier and Type | Interface and Description |
---|---|
static interface |
UserDataService.UserCallback |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_DOMAIN
The
domain given to users who belong to the default domain |
Modifier and Type | Method and Description |
---|---|
void |
addUserGroups(String username,
List<String> groups)
Record additional groups that the user belongs to.
|
long |
countUsers(String domain,
DataCreationState creationState) |
void |
createNewUser(UserData data) |
long |
deleteUsers(DataCreationState creationState)
Delete users by create state
|
UserData |
findUserByEmail(String email)
Find a user by email address
|
UserData |
findUserByUsername(String username)
Find a user by username
|
Iterator<String> |
getDomainsIterator()
An iterator over domains in the users collection.
|
UserData |
getRandomUser()
Select a random, pre-created user.
|
UserData |
getRandomUserFromDomain(String domain)
Select a random, pre-created user.
|
UserData |
getRandomUserFromDomains(List<String> domains)
Select a random, pre-created user that is a member of one of the given domains.
|
List<UserData> |
getUsersByCreationState(DataCreationState creationState,
int startIndex,
int count)
Get the users based on user creation state
|
List<UserData> |
getUsersInDomain(String domain,
int startIndex,
int count)
Access created users by their user domain using paging
|
void |
removeUserGroups(String username,
List<String> groups)
Remove some groups from the user's groups list
|
void |
setUserCreationState(String username,
DataCreationState creationState)
Change the 'created' state of the user i.e.
|
void |
setUserPassword(String username,
String password)
Update a user's password
|
static final String DEFAULT_DOMAIN
domain
given to users who belong to the default domainvoid createNewUser(UserData data)
com.mongodb.DuplicateKeyException
- if the username is already usedvoid setUserCreationState(String username, DataCreationState creationState)
long countUsers(String domain, DataCreationState creationState)
domain
- the domain to search or null for all domainscreationState
- optional creation state to filter the count or null for alllong deleteUsers(DataCreationState creationState)
creationState
- the user creation state to target or null to delete all usersUserData findUserByUsername(String username)
UserData
found otherwise null.UserData findUserByEmail(String email)
UserData
found otherwise null.List<UserData> getUsersByCreationState(DataCreationState creationState, int startIndex, int count)
creationState
- the current creation statestartIndex
- index to start getting users fromcount
- number of users to fetchUserData getRandomUser()
List<UserData> getUsersInDomain(String domain, int startIndex, int count)
domain
- the user domainstartIndex
- the start index for pagingcount
- the number of users to retrieveDEFAULT_DOMAIN
Iterator<String> getDomainsIterator()
DEFAULT_DOMAIN
UserData getRandomUserFromDomain(String domain)
domain
- the user domainDEFAULT_DOMAIN
UserData getRandomUserFromDomains(List<String> domains)
domain
- the user domainDEFAULT_DOMAIN
void addUserGroups(String username, List<String> groups)
username
- the usernamegroups
- new groups for the userCopyright © 2005–2018 Alfresco Software. All rights reserved.