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.UserDataService.UserCallback| Constructor and Description |
|---|
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) |
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.
|
protected List<UserData> |
getUsers(boolean created,
int startIndex,
int count) |
List<UserData> |
getUsersInDomain(String domain,
int startIndex,
int count)
Return a maximum of "max" users in the network with id "networkId".
|
List<UserData> |
getUsersWithoutCloudSignUp(int startIndex,
int count)
Retrieves a selection of users that have no cloud signup details.
|
Iterator<String> |
networksIterator()
An iterator over networks in the users collection.
|
UserData |
randomUser()
Select a random, pre-created user.
|
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()
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 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 retrievepublic Iterator<String> networksIterator()
UserDataServicenetworksIterator in interface UserDataServicepublic UserData findUserByUserName(String userName)
findUserByUserName in interface UserDataServiceUserData found. Null, if user doesn't exist.public UserData randomUser()
UserDataServicerandomUser in interface UserDataServiceCopyright © 2012. All Rights Reserved.