org.apache.james.user.ldap
Class SimpleLDAPConnection

java.lang.Object
  extended by org.apache.james.user.ldap.SimpleLDAPConnection

public class SimpleLDAPConnection
extends java.lang.Object

A connection handle to an LDAP server which is created by means of a simple principal and password/credentials authentication against the LDAP server.


Method Summary
 javax.naming.directory.DirContext getLdapContext()
           Returns the root directory context that is visible to the authenticated user.
static SimpleLDAPConnection openLDAPConnection(java.lang.String principal, java.lang.String credentials, java.lang.String ldapURL)
           Opens a connection to the specified LDAP server using the specified user details.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

openLDAPConnection

public static SimpleLDAPConnection openLDAPConnection(java.lang.String principal,
                                                      java.lang.String credentials,
                                                      java.lang.String ldapURL)
                                               throws javax.naming.NamingException

Opens a connection to the specified LDAP server using the specified user details.

Parameters:
principal - The distinguished-name (DN) of the user to authenticate against the server.
credentials - The credentials with which to authenticate the user e.g. the user's password.
ldapURL - The URL of the LDAP server against which to authenticate the user.
Returns:
A connection to the LDAP host.
Throws:
javax.naming.NamingException - Propagated from the underlying LDAP connection.

getLdapContext

public javax.naming.directory.DirContext getLdapContext()

Returns the root directory context that is visible to the authenticated user.

Returns:
The directory context that is visible to the authenticated user.


Copyright © 2002-2010 The Apache Software Foundation. All Rights Reserved.