|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.messenger.user.UserManager
public class UserManager
Manages users, including loading, creating and deleting.
User
Method Summary | |
---|---|
User |
createUser(String username,
String password,
String name,
String email)
Creates a new User. |
void |
deleteUser(User user)
Deletes a user (optional operation). |
Collection<User> |
findUsers(Set<String> fields,
String query)
earches for users based on a set of fields and a query string. |
static UserManager |
getInstance()
Returns a singleton UserManager instance. |
Set<String> |
getSearchFields()
Returns the set of fields that can be used for searching for users. |
User |
getUser(String username)
Returns the User specified by username. |
int |
getUserCount()
Returns the total number of users in the system. |
static UserProvider |
getUserProvider()
Returns the currently-installed UserProvider. |
Collection<User> |
getUsers()
Returns an unmodifiable Collection of all users in the system. |
Collection<User> |
getUsers(int startIndex,
int numResults)
Returns an unmodifiable Collection of all users starting at startIndex with the given number of results. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static UserProvider getUserProvider()
public static UserManager getInstance()
public User createUser(String username, String password, String name, String email) throws UserAlreadyExistsException
username
- the new and unique username for the account.password
- the password for the account (plain text).email
- the email address to associate with the new account, which can
be null.
UserAlreadyExistsException
- if the username already exists in the system.
UnsupportedOperationException
- if the provider does not support the
operation.public void deleteUser(User user)
user
- the user to delete.public User getUser(String username) throws UserNotFoundException
username
- the username of the user.
UserNotFoundException
- if the user does not exist.public int getUserCount()
public Collection<User> getUsers()
public Collection<User> getUsers(int startIndex, int numResults)
startIndex
- the beginning index to start the results at.numResults
- the total number of results to return.
public Set<String> getSearchFields() throws UnsupportedOperationException
findUsers(Set,String)
method.This method should throw an UnsupportedOperationException if this operation is not supported by the backend user store.
UnsupportedOperationException
- if the provider does not
support the operation (this is an optional operation).public Collection<User> findUsers(Set<String> fields, String query) throws UnsupportedOperationException
getSearchFields()
. The query can
include wildcards. For example, a search on the field "Name" with a query of "Ma*"
might return user's with the name "Matt", "Martha" and "Madeline".This method should throw an UnsupportedOperationException if this operation is not supported by the backend user store.
fields
- the fields to search on.query
- the query string.
UnsupportedOperationException
- if the provider does not
support the operation (this is an optional operation).
|
Jive Messenger 2.2.2 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |