|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.ldap.handler.AbstractConnectionHandler
public abstract class AbstractConnectionHandler
AbstractConnectionHandler provides a basic implementation for
other connection handlers to inherit.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface edu.vt.middleware.ldap.handler.ConnectionHandler |
|---|
ConnectionHandler.ConnectionStrategy |
| Field Summary | |
|---|---|
protected LdapConfig |
config
Ldap configuration. |
protected Class<?>[] |
connectionRetryExceptions
Exception types to retry connections on. |
protected ConnectionHandler.ConnectionStrategy |
connectionStrategy
Ldap connection strategy. |
protected LdapContext |
context
Ldap context. |
protected org.apache.commons.logging.Log |
logger
Log for this class. |
| Constructor Summary | |
|---|---|
AbstractConnectionHandler()
|
|
| Method Summary | |
|---|---|
void |
close()
Close a connection to an LDAP. |
void |
connect(String dn,
Object credential)
Open a connection to an LDAP. |
protected abstract void |
connectInternal(String authtype,
String dn,
Object credential,
Hashtable<String,Object> env)
Create the initial ldap context and prepare the connection for use. |
protected edu.vt.middleware.ldap.handler.AbstractConnectionHandler.ConnectionCount |
getConnectionCount()
Returns the connection count. |
Class<?>[] |
getConnectionRetryExceptions()
This returns the exception types to retry connections on. |
ConnectionHandler.ConnectionStrategy |
getConnectionStrategy()
Returns the connection strategy. |
LdapConfig |
getLdapConfig()
Returns the ldap configuration. |
LdapContext |
getLdapContext()
Returns an ldap context to use for ldap operations. |
boolean |
isConnected()
Returns whether the underlying context has been established. |
abstract ConnectionHandler |
newInstance()
Returns a separate instance of this connection handler with the same underlying ldap configuration. |
protected String[] |
parseLdapUrl(String ldapUrl,
ConnectionHandler.ConnectionStrategy strategy)
Parses the supplied ldap url and splits it into separate URLs if it is space delimited. |
protected void |
setConnectionCount(edu.vt.middleware.ldap.handler.AbstractConnectionHandler.ConnectionCount cc)
Sets the connection count. |
void |
setConnectionRetryExceptions(Class<?>[] exceptions)
This sets the exception types to retry connections on. |
void |
setConnectionStrategy(ConnectionHandler.ConnectionStrategy strategy)
Sets the connection strategy. |
void |
setLdapConfig(LdapConfig lc)
Sets the ldap configuration. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
protected LdapConfig config
protected LdapContext context
protected ConnectionHandler.ConnectionStrategy connectionStrategy
protected Class<?>[] connectionRetryExceptions
| Constructor Detail |
|---|
public AbstractConnectionHandler()
| Method Detail |
|---|
protected edu.vt.middleware.ldap.handler.AbstractConnectionHandler.ConnectionCount getConnectionCount()
protected void setConnectionCount(edu.vt.middleware.ldap.handler.AbstractConnectionHandler.ConnectionCount cc)
cc - connection countpublic ConnectionHandler.ConnectionStrategy getConnectionStrategy()
getConnectionStrategy in interface ConnectionHandlerpublic void setConnectionStrategy(ConnectionHandler.ConnectionStrategy strategy)
setConnectionStrategy in interface ConnectionHandlerstrategy - for making connectionspublic Class<?>[] getConnectionRetryExceptions()
getConnectionRetryExceptions in interface ConnectionHandlerClass[]public void setConnectionRetryExceptions(Class<?>[] exceptions)
setConnectionRetryExceptions in interface ConnectionHandlerexceptions - Class[]public LdapConfig getLdapConfig()
getLdapConfig in interface ConnectionHandlerpublic void setLdapConfig(LdapConfig lc)
setLdapConfig in interface ConnectionHandlerlc - ldap configpublic LdapContext getLdapContext()
ConnectionHandler.connect(String,
Object) must be called prior to invoking this.
getLdapContext in interface ConnectionHandler
public void connect(String dn,
Object credential)
throws NamingException
connect in interface ConnectionHandlerdn - to attempt bind withcredential - to attempt bind with
NamingException - if an LDAP error occurs
protected abstract void connectInternal(String authtype,
String dn,
Object credential,
Hashtable<String,Object> env)
throws NamingException
authtype - security mechanism to bind withdn - to bind ascredential - to bind with in conjunction with dnenv - to pass to the initial ldap context
NamingException - if a connection cannot be establishedpublic boolean isConnected()
isConnected in interface ConnectionHandler
public void close()
throws NamingException
close in interface ConnectionHandlerNamingException - if an LDAP error occurspublic abstract ConnectionHandler newInstance()
newInstance in interface ConnectionHandler
protected String[] parseLdapUrl(String ldapUrl,
ConnectionHandler.ConnectionStrategy strategy)
ldapUrl - to parsestrategy - of ordered array to return
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||