|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.user.ldap.ReadOnlyLDAPUser
public class ReadOnlyLDAPUser
Encapsulates the details of a user as taken from an LDAP compliant directory.
Instances of this class are only applicable to the
ReadOnlyUsersLDAPRepository or its subclasses. Consequently it does
not permit the mutation of user details. It is intended purely as an
encapsulation of the user information as held in the LDAP directory, and as a
means of authenticating the user against the LDAP server. Consequently
invocations of the contract method User.setPassword(String) always
returns false.
SimpleLDAPConnection,
ReadOnlyUsersLDAPRepository,
Serialized Form| Constructor Summary | |
|---|---|
ReadOnlyLDAPUser(String userName,
String userDN,
LdapContext ldapContext)
Constructs an instance for the given user-details, and which will authenticate against the given host. |
|
| Method Summary | |
|---|---|
String |
getUserName()
Fulfils the contract User.getUserName(). |
boolean |
setPassword(String newPass)
Implementation of contract User.setPassword(String), which is
provided for compliance purposes only. |
boolean |
verifyPassword(String password)
Verifies that the password supplied is actually the user's password, by attempting to rebind to a copy of the LDAP server context using the user's username and the supplied password. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReadOnlyLDAPUser(String userName,
String userDN,
LdapContext ldapContext)
throws NamingException
userName - The user-identifier/name. This is the value with which the
field #userName will be initialised, and which will be
returned by invoking getUserName().userDN - The distinguished (unique-key) of the user details as stored
on the LDAP directory.ldapContext - The context for the LDAP server on which the user details are held.
This is also the host against which the user will be
authenticated, when verifyPassword(String) is
invoked.
NamingException| Method Detail |
|---|
public String getUserName()
User.getUserName(). It returns the value of
the field #userName. This is generally the value from which the
user email address is built, by appending the domain name to it.
getUserName in interface Userpublic boolean setPassword(String newPass)
User.setPassword(String), which is
provided for compliance purposes only. Instances of this type mirror LDAP
data and do not perform any updates to the directory. Consequently, this
method always returns false and does not do any work.
setPassword in interface UserFalsepublic boolean verifyPassword(String password)
verifyPassword in interface Userpassword - The password to validate.
True if a connection can successfully be established
to the LDAP host using the user's id and the supplied password,
and False otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||