com.atlassian.user.impl.ldap.repository
Interface LdapContextFactory

All Known Implementing Classes:
DefaultLdapContextFactory

public interface LdapContextFactory

This interface hold all information needed for the Atlassian user implementation to connect to different LDAP systems. Accessors in the class can be divided into two groups - accessors for serving out connection properties or accessors for serving mappings properties. Connection properties are used, obviously, for a connection. Any implementation of this interface should ensure that the behaviours return meaningful information, whether for mapping or for connection. The global constants are there for use in a configuration file, for example a properties file could be used holding connection properties, such as port=389.


Field Summary
static String BASE_GROUP_NAMESPACE
           
static String BASE_USER_NAMESPACE
           
static String BATCH_SIZE
           
static String EMAIL_ATTRIBUTE
           
static String FIRSTNAME_ATTRIBUTE
           
static String GROUP_SEARCH_ALL_DEPTHS
           
static String GROUP_SEARCH_FILTER
           
static String GROUPNAME_ATTRIBUTE
           
static String HOST
           
static String JNDI_INITIAL_CONTEXT_FACTORY
           
static String MEMBERSHIP_ATTRIBUTE
           
static String PASSWORD_ATTRIBUTE
           
static String PORT
           
static String PROVIDER_URL
           
static String SECURITY_AUTHENTICATION
           
static String SECURITY_CREDENTIAL
           
static String SECURITY_PRINCIPAL
           
static String SECURITY_PROTOCOL
           
static String SURNAME_ATTRIBUTE
           
static String TIME_TO_LIVE
           
static String USE_UNQUALIFIED_USER_NAME_FOR_MEMBERSHIP_COMPARISON
           
static String USER_SEARCH_ALL_DEPTHS
           
static String USER_SEARCH_FILTER
           
static String USERNAME_ATTRIBUTE
           
 
Method Summary
 Hashtable getAuthenticationJndiEnvironment(String userDN, String password)
          Returns a JNDI environment suitable for passing to InitialDirContext#InitialContext(Hashtable).
 Hashtable getJNDIEnv()
          Returns a JNDI environment suitable for passing to InitialDirContext.InitialDirContext(Hashtable).
 DirContext getLDAPContext()
          Opens a new connection to the LDAP server.
 

Field Detail

HOST

static final String HOST
See Also:
Constant Field Values

PORT

static final String PORT
See Also:
Constant Field Values

SECURITY_PRINCIPAL

static final String SECURITY_PRINCIPAL
See Also:
Constant Field Values

SECURITY_CREDENTIAL

static final String SECURITY_CREDENTIAL
See Also:
Constant Field Values

SECURITY_AUTHENTICATION

static final String SECURITY_AUTHENTICATION
See Also:
Constant Field Values

PROVIDER_URL

static final String PROVIDER_URL
See Also:
Constant Field Values

JNDI_INITIAL_CONTEXT_FACTORY

static final String JNDI_INITIAL_CONTEXT_FACTORY
See Also:
Constant Field Values

BATCH_SIZE

static final String BATCH_SIZE
See Also:
Constant Field Values

SECURITY_PROTOCOL

static final String SECURITY_PROTOCOL
See Also:
Constant Field Values

TIME_TO_LIVE

static final String TIME_TO_LIVE
See Also:
Constant Field Values

BASE_USER_NAMESPACE

static final String BASE_USER_NAMESPACE
See Also:
Constant Field Values

BASE_GROUP_NAMESPACE

static final String BASE_GROUP_NAMESPACE
See Also:
Constant Field Values

USERNAME_ATTRIBUTE

static final String USERNAME_ATTRIBUTE
See Also:
Constant Field Values

GROUPNAME_ATTRIBUTE

static final String GROUPNAME_ATTRIBUTE
See Also:
Constant Field Values

FIRSTNAME_ATTRIBUTE

static final String FIRSTNAME_ATTRIBUTE
See Also:
Constant Field Values

PASSWORD_ATTRIBUTE

static final String PASSWORD_ATTRIBUTE
See Also:
Constant Field Values

SURNAME_ATTRIBUTE

static final String SURNAME_ATTRIBUTE
See Also:
Constant Field Values

EMAIL_ATTRIBUTE

static final String EMAIL_ATTRIBUTE
See Also:
Constant Field Values

MEMBERSHIP_ATTRIBUTE

static final String MEMBERSHIP_ATTRIBUTE
See Also:
Constant Field Values

USER_SEARCH_ALL_DEPTHS

static final String USER_SEARCH_ALL_DEPTHS
See Also:
Constant Field Values

GROUP_SEARCH_ALL_DEPTHS

static final String GROUP_SEARCH_ALL_DEPTHS
See Also:
Constant Field Values

GROUP_SEARCH_FILTER

static final String GROUP_SEARCH_FILTER
See Also:
Constant Field Values

USER_SEARCH_FILTER

static final String USER_SEARCH_FILTER
See Also:
Constant Field Values

USE_UNQUALIFIED_USER_NAME_FOR_MEMBERSHIP_COMPARISON

static final String USE_UNQUALIFIED_USER_NAME_FOR_MEMBERSHIP_COMPARISON
See Also:
Constant Field Values
Method Detail

getJNDIEnv

Hashtable getJNDIEnv()
Returns a JNDI environment suitable for passing to InitialDirContext.InitialDirContext(Hashtable). The environment is suitable for a connection using all the configuration specified in the other properties on this object.


getAuthenticationJndiEnvironment

Hashtable getAuthenticationJndiEnvironment(String userDN,
                                           String password)
Returns a JNDI environment suitable for passing to InitialDirContext#InitialContext(Hashtable). The environment is suitable for a connection for authenticating the username and password provided.


getLDAPContext

DirContext getLDAPContext()
                          throws RepositoryException
Opens a new connection to the LDAP server.

Returns:
an LDAP directory context suitable for interacting with the LDAP server
Throws:
RepositoryException - if there was a problem opening the connection


Copyright © 2005-2009 Atlassian Software Systems Pty Ltd. All Rights Reserved.