|
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 |
java.lang.Objectcom.jivesoftware.base.UserManagerAdapter
public abstract class UserManagerAdapter
UserManagerAdapter is an abstract class implementation of the IntrospectiveUserManager interface. It assumes that none of the optional capabilities are implemented, and it provides caching. Concrete subclasses must implement lookupUser(String username) and lookupUser(long userid) for the uncached, direct look up of the user data. If they implement any of the optional capabilities, they should also overide the corresponding "is...Supported()" method to return true.
Constructor Summary | |
---|---|
UserManagerAdapter()
|
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)
Implementation that checks cache, if empty calls lookupUser(User) |
User |
getUser(java.lang.String username)
Implementation that calls getUser(getUserID(username)). |
int |
getUserCount()
Returns the number of users in the system. |
long |
getUserID(java.lang.String username)
Checks cache for userID, if it does find it, calls lookupUser(String username), and caches and returns resulting userID. |
boolean |
isCreateUserSupported()
Indicates whether user creation (createUser(String username, String password, String email)) is supported. |
boolean |
isDeleteUserSupported()
Indicates whether user deletion (deleteUser(User user)) is supported. |
boolean |
isGetUserCountSupported()
Indicates whether getting a count of all users (getUserCount()) is supported. |
boolean |
isGetUserFromEmailAddressSupported()
Indicates whether retrieving a user for an email address (getUserFromEmailAddress(String emailAddr)) is supported. |
boolean |
isReadOnly()
|
boolean |
isUserListSupported()
Indicates whether getting an Iterator of all users (users()) is supported. |
protected abstract User |
lookupUser(long userID)
Returns a User with a given user ID. |
protected abstract User |
lookupUser(java.lang.String username)
Returns a User with a given 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UserManagerAdapter()
Method Detail |
---|
public boolean isCreateUserSupported()
IntrospectiveUserManager
isCreateUserSupported
in interface IntrospectiveUserManager
public boolean isDeleteUserSupported()
IntrospectiveUserManager
isDeleteUserSupported
in interface IntrospectiveUserManager
public boolean isGetUserCountSupported()
IntrospectiveUserManager
isGetUserCountSupported
in interface IntrospectiveUserManager
public boolean isUserListSupported()
IntrospectiveUserManager
isUserListSupported
in interface IntrospectiveUserManager
public boolean isGetUserFromEmailAddressSupported()
IntrospectiveUserManager
isGetUserFromEmailAddressSupported
in interface IntrospectiveUserManager
public User createUser(java.lang.String username, java.lang.String password, java.lang.String email) throws UserAlreadyExistsException
UserManager
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
createUser
in interface UserManager
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.public 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
UserManager
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
createUser
in interface UserManager
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.public void deleteUser(User user) throws UnauthorizedException
UserManager
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
deleteUser
in interface UserManager
user
- the user to delete.
UnauthorizedException
public int getUserCount()
UserManager
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
getUserCount
in interface UserManager
public java.util.Iterator users()
UserManager
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
users
in interface UserManager
public java.util.Iterator users(int startIndex, int numResults)
UserManager
If your back-end user store does not support this operation, throw an UnsupportedOperationException.
users
in interface UserManager
startIndex
- the beginning index to start the results at.numResults
- the total number of results to return.
public boolean isReadOnly()
isReadOnly
in interface IntrospectiveUserManager
public User getUser(long userID) throws UserNotFoundException
getUser
in interface UserManager
userID
- the id of the User to lookup.
UserNotFoundException
- if the user does not exist.public User getUser(java.lang.String username) throws UserNotFoundException
getUser
in interface UserManager
username
- the username of the user.
UserNotFoundException
- if the user does not exist.public long getUserID(java.lang.String username) throws UserNotFoundException
getUserID
in interface UserManager
username
- the username of the usedr.
UserNotFoundException
- if the user does not exist.protected abstract User lookupUser(long userID) throws UserNotFoundException
UserNotFoundException
protected abstract User lookupUser(java.lang.String username) throws UserNotFoundException
UserNotFoundException
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |