org.apache.shiro.realm.ldap
Interface LdapContextFactory

All Known Implementing Classes:
DefaultLdapContextFactory

public interface LdapContextFactory

Interface that encapsulates the creation of LdapContext objects that are used by subclasses of AbstractLdapRealm to query for AuthenticationInfo security data (roles, permissions, etc) of particular Subjects (users).

Since:
0.2
Author:
Jeremy Haile

Method Summary
 LdapContext getLdapContext(String username, String password)
          Creates (or retrieves from a pool) a LdapContext connection bound using the username and password specified.
 LdapContext getSystemLdapContext()
          Creates (or retrieves from a pool) a LdapContext connection bound using the system account, or anonymously if no system account is configured.
 

Method Detail

getSystemLdapContext

LdapContext getSystemLdapContext()
                                 throws NamingException
Creates (or retrieves from a pool) a LdapContext connection bound using the system account, or anonymously if no system account is configured.

Returns:
a LdapContext bound by the system account, or bound anonymously if no system account is configured.
Throws:
NamingException - if there is an error creating the context.

getLdapContext

LdapContext getLdapContext(String username,
                           String password)
                           throws NamingException
Creates (or retrieves from a pool) a LdapContext connection bound using the username and password specified.

Parameters:
username - the username to use when creating the connection.
password - the password to use when creating the connection.
Returns:
a LdapContext bound using the given username and password.
Throws:
NamingException - if there is an error creating the context.


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