public interface ConnectionHandler
| Modifier and Type | Interface and Description |
|---|---|
static class |
ConnectionHandler.ConnectionStrategy
Enum to define the type of connection strategy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close a connection to an LDAP.
|
void |
connect(String dn,
Object credential)
Open a connection to an LDAP.
|
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.
|
ConnectionHandler |
newInstance()
Returns a separate instance of this connection handler with the same
underlying ldap configuration.
|
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.
|
ConnectionHandler.ConnectionStrategy getConnectionStrategy()
void setConnectionStrategy(ConnectionHandler.ConnectionStrategy strategy)
strategy - for making connectionsClass<?>[] getConnectionRetryExceptions()
Class[]void setConnectionRetryExceptions(Class<?>[] exceptions)
exceptions - Class[]LdapConfig getLdapConfig()
void setLdapConfig(LdapConfig lc)
lc - ldap configvoid connect(String dn, Object credential) throws NamingException
dn - to attempt bind withcredential - to attempt bind withNamingException - if an LDAP error occursboolean isConnected()
LdapContext getLdapContext() throws NamingException
connect(String,
Object) must be called prior to invoking this.NamingException - if an LDAP error occursvoid close()
throws NamingException
NamingException - if an LDAP error occursConnectionHandler newInstance()
Copyright © 2014. All rights reserved.