public abstract class UserMultiProvider extends Object implements UserProvider
UserProvider
that delegates to one or more 'backing' UserProvider.Constructor and Description |
---|
UserMultiProvider() |
Modifier and Type | Method and Description |
---|---|
Collection<User> |
findUsers(Set<String> fields,
String query)
Searches for users based on a set of fields and a query string.
|
Collection<User> |
findUsers(Set<String> fields,
String query,
int startIndex,
int numResults)
Searches for users based on a set of fields and a query string.
|
Set<String> |
getSearchFields()
Returns the combination of search fields supported by the backing providers.
|
int |
getUserCount()
Returns the number of users in the system.
|
Collection<String> |
getUsernames()
Returns an unmodifiable Collection of usernames of all users in the system.
|
Collection<User> |
getUsers()
Returns an unmodifiable Collections of all users in the system.
|
Collection<User> |
getUsers(int startIndex,
int numResults)
Returns an unmodifiable Collections of users in the system within the
specified range.
|
static UserProvider |
instantiate(String propertyName)
Instantiates a UserProvider based on a property value (that is expected to be a class name).
|
boolean |
isEmailRequired()
Returns whether all backing providers require an email address to be set on User objects.
|
boolean |
isNameRequired()
Returns whether all backing providers require a name to be set on User objects.
|
boolean |
isReadOnly()
Returns whether all backing providers are read-only.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createUser, deleteUser, loadUser, setCreationDate, setEmail, setModificationDate, setName
public static UserProvider instantiate(String propertyName)
propertyName
- A property name (cannot ben ull).public int getUserCount()
UserProvider
getUserCount
in interface UserProvider
public Collection<User> getUsers()
UserProvider
UserCollection
class can be used to assist in the implementation
of this method. It takes a String [] of usernames and presents it as a
Collection of User objects (obtained with calls to
UserManager.getUser(String)
.getUsers
in interface UserProvider
public Collection<String> getUsernames()
UserProvider
getUsernames
in interface UserProvider
public Collection<User> getUsers(int startIndex, int numResults)
UserProvider
UserCollection
class can be used to assist
in the implementation of this method. It takes a String [] of usernames
and presents it as a Collection of User objects (obtained with calls to
UserManager.getUser(String)
.It is possible that the number of results returned will be less than that specified by numResults if numResults is greater than the number of records left to display.
getUsers
in interface UserProvider
startIndex
- the beginning index to start the results at.numResults
- the total number of results to return.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 throws an UnsupportedOperationException when none of the backing providers support search.
When fields are provided that are not supported by a particular provider, those fields are ignored by that
provider (but can still be used by other providers).findUsers
in interface UserProvider
fields
- the fields to search on.query
- the query string.UnsupportedOperationException
- When none of the providers support search.public Collection<User> findUsers(Set<String> fields, String query, int startIndex, int numResults) 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 throws an UnsupportedOperationException when none of the backing providers support search.
When fields are provided that are not supported by a particular provider, those fields are ignored by that
provider (but can still be used by other providers).
The startIndex and numResults parameters are used to page through search results. For example, if the startIndex
is 0 and numResults is 10, the first 10 search results will be returned. Note that numResults is a request for
the number of results to return and that the actual number of results returned may be fewer.findUsers
in interface UserProvider
fields
- the fields to search on.query
- the query string.startIndex
- the starting index in the search result to return.numResults
- the number of users to return in the search result.UnsupportedOperationException
- When none of the providers support search.public Set<String> getSearchFields() throws UnsupportedOperationException
getSearchFields
in interface UserProvider
UnsupportedOperationException
- If no search fields are returned, or when at least one of the providers throws UnsupportedOperationException when its #getSearchField() is invoked.public boolean isReadOnly()
isReadOnly
in interface UserProvider
public boolean isNameRequired()
isNameRequired
in interface UserProvider
public boolean isEmailRequired()
isEmailRequired
in interface UserProvider
Copyright © 2003-2008 Jive Software.