|
Jive Forums API (5.5.20.2-oracle) Developer Javadocs | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UserManager
Centralized management of users in the Jive system including creating, retrieving, and deleting User objects.
Instructions for those that wish to implement this interface to provide a custom implementation appear in red. If you wish to use a custom implementation, you must set the Jive property UserManager.className with the name of your UserManager class. Your class must have a public, no-argument constructor. The class must also create and return User object implementations as necessary.
User
Method Summary | |
---|---|
User |
createUser(java.lang.String username,
java.lang.String password,
java.lang.String email)
Factory method for creating a new User with all required values: a password, email address, and unique username. |
User |
createUser(java.lang.String username,
java.lang.String password,
java.lang.String name,
java.lang.String email,
boolean nameVisible,
boolean emailVisible,
java.util.Map properties)
Factory method for creating a new User with all required AND optional values. |
void |
deleteUser(User user)
Deletes a user. |
User |
getUser(long userID)
Returns a User specified by their ID. |
User |
getUser(java.lang.String username)
Returns the User specified by username. |
int |
getUserCount()
Returns the number of users in the system. |
long |
getUserID(java.lang.String username)
Returns the userID specified by the username. |
java.util.Iterator |
users()
Returns an iterator for all users in the system. |
java.util.Iterator |
users(int startIndex,
int numResults)
Returns an iterator for all users starting at startIndex with the given number of results. |
Method Detail |
---|
User createUser(java.lang.String username, java.lang.String password, java.lang.String email) throws UserAlreadyExistsException
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
username
- the new and unique username for the account.password
- the password for the account as plain text.email
- the email address for the account.
UserAlreadyExistsException
- if the username already exists in the system.User createUser(java.lang.String username, java.lang.String password, java.lang.String name, java.lang.String email, boolean nameVisible, boolean emailVisible, java.util.Map properties) throws UserAlreadyExistsException
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
username
- the new and unique username for the account.password
- the password for the account as plain text.name
- the name for the account.email
- the email address for the account.nameVisible
- true if the user's name should be visible to others.emailVisible
- true if the user's email address should be visible to others.properties
- the user's extended properties.
UserAlreadyExistsException
- if the username already exists in the system.User getUser(long userID) throws UserNotFoundException
Because this method will be called often by other parts of the API,
a cache of User objects should be used. UserManagerFactory.userCache
can be
used for this purpose. The algorithm should be:
userID
- the id of the User to lookup.
UserNotFoundException
- if the user does not exist.User getUser(java.lang.String username) throws UserNotFoundException
The method should typically be implemented as:
return getUser(getUserID(username));
username
- the username of the user.
UserNotFoundException
- if the user does not exist.long getUserID(java.lang.String username) throws UserNotFoundException
Because this method will be called often by other parts of the API,
a cache should be used that maps usernames to userIDs. UserManagerFactory.userIDCache
can be used for this purpose. The algorithm should be:
username
- the username of the usedr.
UserNotFoundException
- if the user does not exist.void deleteUser(User user) throws UnauthorizedException
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
user
- the user to delete.
UnauthorizedException
int getUserCount()
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
java.util.Iterator users()
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
java.util.Iterator users(int startIndex, int numResults)
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
startIndex
- the beginning index to start the results at.numResults
- the total number of results to return.
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |