|
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.UserManagerProxy
public class UserManagerProxy
Protection proxy for the UserManager class. It restricts access to protected methods by throwing UnauthorizedExceptions when necessary.
UserManager
Constructor Summary | |
---|---|
UserManagerProxy(UserManager userManager,
AuthToken auth,
Permissions permissions)
Creates a new UserManagerProxy. |
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. |
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 void |
testNumSeats()
|
protected void |
triggerEmailExceeded(com.jivesoftware.base.license.Product product,
com.jivesoftware.base.license.License license)
|
protected void |
triggerEmailWarning(com.jivesoftware.base.license.Product product,
com.jivesoftware.base.license.License license)
|
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 UserManagerProxy(UserManager userManager, AuthToken auth, Permissions permissions)
Method Detail |
---|
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 User getUser(long userID) throws UserNotFoundException
UserManager
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:
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
UserManager
The method should typically be implemented as:
return getUser(getUserID(username));
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
UserManager
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:
getUserID
in interface UserManager
username
- the username of the usedr.
UserNotFoundException
- if the user does not exist.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 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 boolean isReadOnly()
isReadOnly
in interface IntrospectiveUserManager
protected void testNumSeats() throws com.jivesoftware.base.license.LicenseException
com.jivesoftware.base.license.LicenseException
protected void triggerEmailWarning(com.jivesoftware.base.license.Product product, com.jivesoftware.base.license.License license)
protected void triggerEmailExceeded(com.jivesoftware.base.license.Product product, com.jivesoftware.base.license.License license)
|
Jive Forums Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |