|
|||||||||
| 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(java.lang.String userName,
java.lang.String userDN,
java.lang.String ldapURL)
Constructs an instance for the given user-details, and which will authenticate against the given host. |
|
| Method Summary | |
|---|---|
java.lang.String |
getUserName()
Fulfils the contract User.getUserName(). |
boolean |
setPassword(java.lang.String newPass)
Implementation of contract User.setPassword(String), which is
provided for compliance purposes only. |
boolean |
verifyPassword(java.lang.String password)
Verifies that the password supplied is actually the user's password, by attempting to bind to the LDAP server 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(java.lang.String userName,
java.lang.String userDN,
java.lang.String ldapURL)
Constructs an instance for the given user-details, and which will authenticate against the given host.
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.ldapURL - The URL of 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.| Method Detail |
|---|
public java.lang.String getUserName()
Fulfils the contract 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(java.lang.String newPass)
Implementation of contract 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(java.lang.String password)
Verifies that the password supplied is actually the user's password, by attempting to bind to the LDAP server using the user's username and the supplied 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. Please note that if the LDAP server has suffered a crash or failure
in between the initialisation of the user repository and the invocation of this method,
the result will still be false.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||