|
Jive Forums API (5.5.8) Developer Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.base.ldap.LdapUserManager
public class LdapUserManager
LDAP connections are made via JNDI using the Sun LDAP provider.
| Field Summary | |
|---|---|
static Cache |
userEmailCache
|
| Constructor Summary | |
|---|---|
LdapUserManager()
|
|
| 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. |
User |
getUserFromEmailAddress(java.lang.String email)
Returns a user object corresponding to the email address given. |
long |
getUserID(java.lang.String username)
Returns the userID specified by the username. |
java.util.Iterator |
getUsersFromEmailAddress(java.lang.String email)
Returns an iterator of user objects corresponding to the email address given. |
boolean |
isCreateUserSupported()
Creation of users in ldap implementation is not supported |
boolean |
isDeleteUserSupported()
true, however ldap will remain unaffected |
boolean |
isGetUserCountSupported()
supported, returns true |
boolean |
isGetUserFromEmailAddressSupported()
supported, returns true |
boolean |
isReadOnly()
returns false |
boolean |
isUserListSupported()
supported, returns true |
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 |
| Field Detail |
|---|
public static Cache userEmailCache
| Constructor Detail |
|---|
public LdapUserManager()
| Method Detail |
|---|
public User createUser(java.lang.String username,
java.lang.String password,
java.lang.String email)
throws UserAlreadyExistsException
UserManagerIf your back-end user store does not support this operation, throw an UnsupportedOperationException.
createUser in interface UserManagerusername - 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
UserManagerIf your back-end user store does not support this operation, throw an UnsupportedOperationException.
createUser in interface UserManagerusername - 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 UserManageruserID - 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 UserManagerusername - 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 UserManagerusername - the username of the usedr.
UserNotFoundException - if the user does not exist.
public void deleteUser(User user)
throws UnauthorizedException
UserManagerIf your back-end user store does not support this operation, throw an UnsupportedOperationException.
deleteUser in interface UserManageruser - the user to delete.
UnauthorizedExceptionpublic int getUserCount()
UserManagerIf your back-end user store does not support this operation, throw an UnsupportedOperationException.
getUserCount in interface UserManagerpublic java.util.Iterator users()
UserManagerIf 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)
UserManagerIf your back-end user store does not support this operation, throw an UnsupportedOperationException.
users in interface UserManagerstartIndex - the beginning index to start the results at.numResults - the total number of results to return.
public User getUserFromEmailAddress(java.lang.String email)
AdvancedUserManager
getUserFromEmailAddress in interface AdvancedUserManageremail - the email address to get a user object for.
public java.util.Iterator getUsersFromEmailAddress(java.lang.String email)
AdvancedUserManager
getUsersFromEmailAddress in interface AdvancedUserManageremail - the email address to get a user object for.
public boolean isCreateUserSupported()
isCreateUserSupported in interface IntrospectiveUserManagerpublic boolean isDeleteUserSupported()
isDeleteUserSupported in interface IntrospectiveUserManagerpublic boolean isGetUserCountSupported()
isGetUserCountSupported in interface IntrospectiveUserManagerpublic boolean isUserListSupported()
isUserListSupported in interface IntrospectiveUserManagerpublic boolean isGetUserFromEmailAddressSupported()
isGetUserFromEmailAddressSupported in interface IntrospectiveUserManagerpublic boolean isReadOnly()
isReadOnly in interface IntrospectiveUserManager
|
Jive Forums Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||