Package edu.vt.middleware.ldap.handler
Class DefaultConnectionHandler
- java.lang.Object
-
- edu.vt.middleware.ldap.handler.AbstractConnectionHandler
-
- edu.vt.middleware.ldap.handler.DefaultConnectionHandler
-
- All Implemented Interfaces:
ConnectionHandler
- Direct Known Subclasses:
TlsConnectionHandler
public class DefaultConnectionHandler extends AbstractConnectionHandler
DefaultConnectionHandler
creates a newLdapContext
using environment properties obtained fromLdapConfig.getEnvironment()
.- Version:
- $Revision: 2231 $
- 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
Constructors Constructor Description DefaultConnectionHandler()
Default constructor.DefaultConnectionHandler(DefaultConnectionHandler ch)
Copy constructor forDefaultConnectionHandler
.DefaultConnectionHandler(LdapConfig lc)
Creates a newDefaultConnectionHandler
with the supplied ldap config.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
connectInternal(java.lang.String authtype, java.lang.String dn, java.lang.Object credential, java.util.Hashtable<java.lang.String,java.lang.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
-
-
-
-
Constructor Detail
-
DefaultConnectionHandler
public DefaultConnectionHandler()
Default constructor.
-
DefaultConnectionHandler
public DefaultConnectionHandler(LdapConfig lc)
Creates a newDefaultConnectionHandler
with the supplied ldap config.- Parameters:
lc
- ldap config
-
DefaultConnectionHandler
public DefaultConnectionHandler(DefaultConnectionHandler ch)
Copy constructor forDefaultConnectionHandler
.- Parameters:
ch
- to copy properties from
-
-
Method Detail
-
connectInternal
protected void connectInternal(java.lang.String authtype, java.lang.String dn, java.lang.Object credential, java.util.Hashtable<java.lang.String,java.lang.Object> env) throws javax.naming.NamingException
Create the initial ldap context and prepare the connection for use.- Specified by:
connectInternal
in classAbstractConnectionHandler
- Parameters:
authtype
- security mechanism to bind withdn
- to bind ascredential
- to bind with in conjunction with dnenv
- to pass to the initial ldap context- Throws:
javax.naming.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 interfaceConnectionHandler
- Specified by:
newInstance
in classAbstractConnectionHandler
- Returns:
- connection handler
-
-