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 java.lang.String BASE_GROUP_NAMESPACE
           
static java.lang.String BASE_USER_NAMESPACE
           
static java.lang.String BATCH_SIZE
           
static java.lang.String EMAIL_ATTRIBUTE
           
static java.lang.String FIRSTNAME_ATTRIBUTE
           
static java.lang.String GROUP_SEARCH_ALL_DEPTHS
           
static java.lang.String GROUP_SEARCH_FILTER
           
static java.lang.String GROUPNAME_ATTRIBUTE
           
static java.lang.String HOST
           
static java.lang.String JNDI_INITIAL_CONTEXT_FACTORY
           
static java.lang.String MEMBERSHIP_ATTRIBUTE
           
static java.lang.String PASSWORD_ATTRIBUTE
           
static java.lang.String PORT
           
static java.lang.String PROVIDER_URL
           
static java.lang.String SECURITY_AUTHENTICATION
           
static java.lang.String SECURITY_CREDENTIAL
           
static java.lang.String SECURITY_PRINCIPAL
           
static java.lang.String SECURITY_PROTOCOL
           
static java.lang.String SURNAME_ATTRIBUTE
           
static java.lang.String TIME_TO_LIVE
           
static java.lang.String USE_UNQUALIFIED_USER_NAME_FOR_MEMBERSHIP_COMPARISON
           
static java.lang.String USER_SEARCH_ALL_DEPTHS
           
static java.lang.String USER_SEARCH_FILTER
           
static java.lang.String USERNAME_ATTRIBUTE
           
 
Method Summary
 java.util.Hashtable getAuthenticationJndiEnvironment(java.lang.String userDN, java.lang.String password)
          Returns a JNDI environment suitable for passing to InitialDirContext#InitialContext(Hashtable).
 java.util.Hashtable getJNDIEnv()
          Returns a JNDI environment suitable for passing to InitialDirContext.InitialDirContext(Hashtable).
 javax.naming.directory.DirContext getLDAPContext()
          Opens a new connection to the LDAP server.
 

Field Detail

HOST

public static final java.lang.String HOST
See Also:
Constant Field Values

PORT

public static final java.lang.String PORT
See Also:
Constant Field Values

SECURITY_PRINCIPAL

public static final java.lang.String SECURITY_PRINCIPAL
See Also:
Constant Field Values

SECURITY_CREDENTIAL

public static final java.lang.String SECURITY_CREDENTIAL
See Also:
Constant Field Values

SECURITY_AUTHENTICATION

public static final java.lang.String SECURITY_AUTHENTICATION
See Also:
Constant Field Values

PROVIDER_URL

public static final java.lang.String PROVIDER_URL
See Also:
Constant Field Values

JNDI_INITIAL_CONTEXT_FACTORY

public static final java.lang.String JNDI_INITIAL_CONTEXT_FACTORY
See Also:
Constant Field Values

BATCH_SIZE

public static final java.lang.String BATCH_SIZE
See Also:
Constant Field Values

SECURITY_PROTOCOL

public static final java.lang.String SECURITY_PROTOCOL
See Also:
Constant Field Values

TIME_TO_LIVE

public static final java.lang.String TIME_TO_LIVE
See Also:
Constant Field Values

BASE_USER_NAMESPACE

public static final java.lang.String BASE_USER_NAMESPACE
See Also:
Constant Field Values

BASE_GROUP_NAMESPACE

public static final java.lang.String BASE_GROUP_NAMESPACE
See Also:
Constant Field Values

USERNAME_ATTRIBUTE

public static final java.lang.String USERNAME_ATTRIBUTE
See Also:
Constant Field Values

GROUPNAME_ATTRIBUTE

public static final java.lang.String GROUPNAME_ATTRIBUTE
See Also:
Constant Field Values

FIRSTNAME_ATTRIBUTE

public static final java.lang.String FIRSTNAME_ATTRIBUTE
See Also:
Constant Field Values

PASSWORD_ATTRIBUTE

public static final java.lang.String PASSWORD_ATTRIBUTE
See Also:
Constant Field Values

SURNAME_ATTRIBUTE

public static final java.lang.String SURNAME_ATTRIBUTE
See Also:
Constant Field Values

EMAIL_ATTRIBUTE

public static final java.lang.String EMAIL_ATTRIBUTE
See Also:
Constant Field Values

MEMBERSHIP_ATTRIBUTE

public static final java.lang.String MEMBERSHIP_ATTRIBUTE
See Also:
Constant Field Values

USER_SEARCH_ALL_DEPTHS

public static final java.lang.String USER_SEARCH_ALL_DEPTHS
See Also:
Constant Field Values

GROUP_SEARCH_ALL_DEPTHS

public static final java.lang.String GROUP_SEARCH_ALL_DEPTHS
See Also:
Constant Field Values

GROUP_SEARCH_FILTER

public static final java.lang.String GROUP_SEARCH_FILTER
See Also:
Constant Field Values

USER_SEARCH_FILTER

public static final java.lang.String USER_SEARCH_FILTER
See Also:
Constant Field Values

USE_UNQUALIFIED_USER_NAME_FOR_MEMBERSHIP_COMPARISON

public static final java.lang.String USE_UNQUALIFIED_USER_NAME_FOR_MEMBERSHIP_COMPARISON
See Also:
Constant Field Values
Method Detail

getJNDIEnv

public java.util.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

public java.util.Hashtable getAuthenticationJndiEnvironment(java.lang.String userDN,
                                                            java.lang.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

public javax.naming.directory.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-2008 Atlassian Software Systems Pty Ltd. All Rights Reserved.