public class UserDataServiceImpl extends AbstractUserDataService implements org.springframework.beans.factory.InitializingBean
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 | Class and Description |
|---|---|
static class |
UserDataServiceImpl.Range |
UserDataService.UserCallbackDEFAULT_DOMAIN| Constructor and Description |
|---|
UserDataServiceImpl(com.mongodb.Mongo mongo,
String dbName,
String collectionName)
Deprecated.
|
UserDataServiceImpl(org.springframework.data.mongodb.core.MongoTemplate mongo,
String collectionName) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
long |
countCloudAwareUsers()
Count the number of cloud-enabled users, regardless of signup state
|
long |
countUsers() |
long |
countUsers(boolean created) |
long |
countUsers(String domain,
boolean created) |
void |
createNewUser(UserData data) |
UserData |
findUserByEmail(String email)
Find a user by email address
|
UserData |
findUserByUsername(String username)
Find a user by username
|
UserData |
findUserByUserName(String userName)
Find a user by it's username.
|
Iterator<String> |
getDomainsIterator()
An iterator over networks 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.
|
protected List<UserData> |
getUsers(boolean created,
int startIndex,
int count) |
Iterator<UserData> |
getUsersByDomainIterator(String domain)
Iterate over users in the given network.
|
List<UserData> |
getUsersInDomain(String domain,
int startIndex,
int count)
Access users by their user domain using paging
|
List<UserData> |
getUsersInDomain(String domain,
int startIndex,
int count,
boolean created)
Return a maximum of "max" users in the network with id "networkId" and given created flag.
|
List<UserData> |
getUsersWithoutCloudSignUp(int startIndex,
int count)
Retrieves a selection of users that have no cloud signup details.
|
void |
setUserCloudSignUp(String username,
CloudSignUpData cloudSignUp)
Set the registration data for a user
|
void |
setUserCreated(String username,
boolean created)
Change the 'created' state of the user i.e.
|
void |
setUserNodeId(String username,
String nodeId)
Store a node ID associated with the username
|
void |
setUserPassword(String username,
String password)
Update a user's password
|
void |
setUserTicket(String username,
String ticket)
Store an authentication token (ticket) against a username
|
getCreatedUsers, getUsersPendingCreationpublic UserDataServiceImpl(org.springframework.data.mongodb.core.MongoTemplate mongo,
String collectionName)
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic void createNewUser(UserData data)
createNewUser in interface UserDataServicepublic void setUserTicket(String username, String ticket)
setUserTicket in interface UserDataServicepublic void setUserPassword(String username, String password)
setUserPassword in interface UserDataServicepublic void setUserNodeId(String username, String nodeId)
setUserNodeId in interface UserDataServicepublic void setUserCreated(String username, boolean created)
setUserCreated in interface UserDataServicepublic long countUsers(boolean created)
countUsers in interface UserDataServicecreated - true to only count users present in Alfrescopublic long countUsers(String domain, boolean created)
countUsers in interface UserDataServicedomain - the domain to searchcreated - true to only count users present in Alfrescopublic long countUsers()
countUsers in interface UserDataServicepublic UserData findUserByUsername(String username)
findUserByUsername in interface UserDataServiceUserData found otherwise nullpublic UserData findUserByEmail(String email)
findUserByEmail in interface UserDataServiceUserData found otherwise nullprotected List<UserData> getUsers(boolean created, int startIndex, int count)
getUsers in class AbstractUserDataServicecreated - true to only count users present in Alfrescopublic UserData getRandomUser()
UserDataServicegetRandomUser in interface UserDataServicepublic void setUserCloudSignUp(String username, CloudSignUpData cloudSignUp)
setUserCloudSignUp in interface UserDataServiceusername - the usernamecloudSignUp - the new registration data to setpublic long countCloudAwareUsers()
countCloudAwareUsers in interface UserDataServicepublic List<UserData> getUsersWithoutCloudSignUp(int startIndex, int count)
getUsersWithoutCloudSignUp in interface UserDataServicepublic List<UserData> getUsersInDomain(String domain, int startIndex, int count)
UserDataServicegetUsersInDomain in interface UserDataServicedomain - the user domainstartIndex - the start index for pagingcount - the number of users to retrieveUserDataService.DEFAULT_DOMAINpublic List<UserData> getUsersInDomain(String domain, int startIndex, int count, boolean created)
UserDataServicegetUsersInDomain in interface UserDataServicedomain - the user domainstartIndex - the start index for pagingcount - the number of users to retrievecreated - is the user created or not?UserDataService.DEFAULT_DOMAINpublic Iterator<String> getDomainsIterator()
UserDataServicegetDomainsIterator in interface UserDataServiceUserDataService.DEFAULT_DOMAINpublic UserData findUserByUserName(String userName)
findUserByUserName in interface UserDataServiceUserData found. Null, if user doesn't exist.UserDataService.DEFAULT_DOMAINpublic UserData getRandomUserFromDomain(String domain)
UserDataServicegetRandomUserFromDomain in interface UserDataServicedomain - the user domainUserDataService.DEFAULT_DOMAINpublic UserData getRandomUserFromDomains(List<String> domains)
UserDataServicegetRandomUserFromDomains in interface UserDataServiceUserDataService.DEFAULT_DOMAINpublic Iterator<UserData> getUsersByDomainIterator(String domain)
UserDataServicegetUsersByDomainIterator in interface UserDataServicedomain - the user domainUserDataService.DEFAULT_DOMAINCopyright © 2014. All rights reserved.