edu.vt.middleware.ldap.handler
Class DefaultConnectionHandler

java.lang.Object
  extended by edu.vt.middleware.ldap.handler.AbstractConnectionHandler
      extended by edu.vt.middleware.ldap.handler.DefaultConnectionHandler
All Implemented Interfaces:
ConnectionHandler
Direct Known Subclasses:
TlsConnectionHandler

public class DefaultConnectionHandler
extends AbstractConnectionHandler

DefaultConnectionHandler creates a new LdapContext using environment properties obtained from LdapConfig.getEnvironment().

Version:
$Revision: 1442 $
Author:
Middleware Services

Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.vt.middleware.ldap.handler.ConnectionHandler
ConnectionHandler.ConnectionStrategy
 
Field Summary
 
Fields inherited from class edu.vt.middleware.ldap.handler.AbstractConnectionHandler
config, connectionRetryExceptions, connectionStrategy, context, logger
 
Constructor Summary
DefaultConnectionHandler()
          Default constructor.
DefaultConnectionHandler(DefaultConnectionHandler ch)
          Copy constructor for DefaultConnectionHandler.
DefaultConnectionHandler(LdapConfig lc)
          Creates a new DefaultConnectionHandler with the supplied ldap config.
 
Method Summary
protected  void connectInternal(String authtype, String dn, Object credential, Hashtable<String,Object> env)
          Create the initial ldap context and prepare the connection for use.
 DefaultConnectionHandler newInstance()
          Returns a separate instance of this connection handler with the same underlying ldap configuration.
 
Methods inherited from class edu.vt.middleware.ldap.handler.AbstractConnectionHandler
close, connect, getConnectionCount, getConnectionRetryExceptions, getConnectionStrategy, getLdapConfig, getLdapContext, isConnected, parseLdapUrl, setConnectionCount, setConnectionRetryExceptions, setConnectionStrategy, setLdapConfig
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultConnectionHandler

public DefaultConnectionHandler()
Default constructor.


DefaultConnectionHandler

public DefaultConnectionHandler(LdapConfig lc)
Creates a new DefaultConnectionHandler with the supplied ldap config.

Parameters:
lc - ldap config

DefaultConnectionHandler

public DefaultConnectionHandler(DefaultConnectionHandler ch)
Copy constructor for DefaultConnectionHandler.

Parameters:
ch - to copy properties from
Method Detail

connectInternal

protected void connectInternal(String authtype,
                               String dn,
                               Object credential,
                               Hashtable<String,Object> env)
                        throws NamingException
Create the initial ldap context and prepare the connection for use.

Specified by:
connectInternal in class AbstractConnectionHandler
Parameters:
authtype - security mechanism to bind with
dn - to bind as
credential - to bind with in conjunction with dn
env - to pass to the initial ldap context
Throws:
NamingException - if a connection cannot be established

newInstance

public DefaultConnectionHandler newInstance()
Returns a separate instance of this connection handler with the same underlying ldap configuration.

Specified by:
newInstance in interface ConnectionHandler
Specified by:
newInstance in class AbstractConnectionHandler
Returns:
connection handler


Copyright © 2003-2010 Virginia Tech. All Rights Reserved.