|
Openfire 3.7.1 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jivesoftware.openfire.clearspace.ClearspaceUserProvider
public class ClearspaceUserProvider
The ClearspaceUserProvider uses the UserService and ProfileSearchService web service inside of Clearspace to retrieve user information and to search for users from Clearspace.
Field Summary | |
---|---|
protected static String |
SEARCH_URL_PREFIX
|
protected static String |
USER_URL_PREFIX
|
Constructor Summary | |
---|---|
ClearspaceUserProvider()
|
Method Summary | |
---|---|
User |
createUser(String username,
String password,
String name,
String email)
Creates user using the userService/users POST service. |
void |
deleteUser(String username)
Deletes a user using the userService/users DELETE service. |
Collection<User> |
findUsers(Set<String> fields,
String query)
Search for the user using the userService/search POST method. |
Collection<User> |
findUsers(Set<String> fields,
String query,
int startIndex,
int numResults)
Search for the user using the userService/searchBounded POST method. |
Set<String> |
getSearchFields()
Clearsapce can search using three fields: username, name and email. |
int |
getUserCount()
Gets the user count using the userService/users/count GET service. |
Collection<String> |
getUsernames()
Gets all usernames using the userService/userNames GET service. |
Collection<User> |
getUsers()
Gets all users using the userService/userNames GET service. |
Collection<User> |
getUsers(int startIndex,
int numResults)
Gets a bounded list of users using the userService/userNames GET service. |
protected org.dom4j.Element |
getUserUpdateParams(String username)
Creates the parameters to send in a update user request based on the information of username |
boolean |
isEmailRequired()
In Clearspace email is required |
boolean |
isNameRequired()
In Clearspace name is optional. |
boolean |
isReadOnly()
Returns true if Clearspace is a read only user provider. |
User |
loadUser(String username)
Loads the user using the userService/users GET service. |
void |
setCreationDate(String username,
Date creationDate)
Updates the creationDate of the user using the userService/update service. |
void |
setEmail(String username,
String email)
Updates the email of the user using the userService/update service. |
void |
setModificationDate(String username,
Date modificationDate)
Updates the modificationDate of the user using the userService/update service. |
void |
setName(String username,
String name)
Updates the name of the user using the userService/update service. |
protected void |
updateUser(org.dom4j.Element userUpdateParams)
Updates the user using the userService/users PUT service. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String USER_URL_PREFIX
protected static final String SEARCH_URL_PREFIX
Constructor Detail |
---|
public ClearspaceUserProvider()
Method Detail |
---|
public User loadUser(String username) throws UserNotFoundException
loadUser
in interface UserProvider
username
- the username of the user to load
UserNotFoundException
- if the user could not be foundpublic User createUser(String username, String password, String name, String email) throws UserAlreadyExistsException
createUser
in interface UserProvider
username
- the username of the userpassword
- the password of the username
- the name of the user (optional)email
- the email of the user
UserAlreadyExistsException
- If there is already a user with the username
UnsupportedOperationException
- If Clearspace is a read only providerpublic void deleteUser(String username)
deleteUser
in interface UserProvider
username
- the username of the user to deletepublic int getUserCount()
getUserCount
in interface UserProvider
public Collection<User> getUsers()
getUsers
in interface UserProvider
public Collection<String> getUsernames()
getUsernames
in interface UserProvider
public Collection<User> getUsers(int startIndex, int numResults)
getUsers
in interface UserProvider
startIndex
- the start indexnumResults
- the number of result
public void setName(String username, String name) throws UserNotFoundException
setName
in interface UserProvider
username
- the username of the username
- the new name of the user
UserNotFoundException
- if there is no user with that usernamepublic void setEmail(String username, String email) throws UserNotFoundException
setEmail
in interface UserProvider
username
- the username of the useremail
- the new email of the user
UserNotFoundException
- if the user could not be foundpublic void setCreationDate(String username, Date creationDate) throws UserNotFoundException
setCreationDate
in interface UserProvider
username
- the username of the usercreationDate
- the new email of the user
UserNotFoundException
- if the user could not be foundpublic void setModificationDate(String username, Date modificationDate) throws UserNotFoundException
setModificationDate
in interface UserProvider
username
- the username of the usermodificationDate
- the new modificationDate of the user
UserNotFoundException
- if the user could not be foundprotected org.dom4j.Element getUserUpdateParams(String username) throws UserNotFoundException
username
username
- the username of the user
UserNotFoundException
- if the user could not be foundprotected void updateUser(org.dom4j.Element userUpdateParams) throws UserNotFoundException
userUpdateParams
- the request parameters
UserNotFoundException
- if the user could not be foundpublic Set<String> getSearchFields() throws UnsupportedOperationException
getSearchFields
in interface UserProvider
UnsupportedOperationException
public Collection<User> findUsers(Set<String> fields, String query) throws UnsupportedOperationException
findUsers
in interface UserProvider
fields
- the fields to search on.query
- the query string.
UnsupportedOperationException
- if the provider does not
support the operation (this is an optional operation).public Collection<User> findUsers(Set<String> fields, String query, int startIndex, int numResults) throws UnsupportedOperationException
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
- if the provider does not
support the operation (this is an optional operation).public boolean isReadOnly()
isReadOnly
in interface UserProvider
public boolean isNameRequired()
isNameRequired
in interface UserProvider
public boolean isEmailRequired()
isEmailRequired
in interface UserProvider
|
Openfire 3.7.1 Javadoc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |