|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.vt.middleware.ldap.handler.AbstractConnectionHandler
edu.vt.middleware.ldap.handler.DefaultConnectionHandler
edu.vt.middleware.ldap.handler.TlsConnectionHandler
public class TlsConnectionHandler
TlsConnectionHandler creates a new LdapContext
using environment properties obtained from LdapConfig.getEnvironment() and then invokes the startTLS extended operation
on the context. SSLSocketFactory and
HostnameVerifier properties are used from the
LdapContext.
| 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 | |
|---|---|
TlsConnectionHandler()
Default constructor. |
|
TlsConnectionHandler(LdapConfig lc)
Creates a new TlsConnectionHandler with the supplied ldap
config. |
|
TlsConnectionHandler(TlsConnectionHandler ch)
Copy constructor for TlsConnectionHandler. |
|
| Method Summary | |
|---|---|
void |
close()
Close a connection to an LDAP. |
protected void |
connectInternal(String authtype,
String dn,
Object credential,
Hashtable<String,Object> env)
Create the initial ldap context and prepare the connection for use. |
StartTlsResponse |
getStartTlsResponse()
This returns the startTLS response created by a call to AbstractConnectionHandler.connect(String, Object). |
boolean |
getStopTlsOnClose()
Returns whether to call StartTlsResponse.close() when close() is called. |
TlsConnectionHandler |
newInstance()
Returns a separate instance of this connection handler with the same underlying ldap configuration. |
void |
setStopTlsOnClose(boolean b)
Sets whether to call StartTlsResponse.close() when close()
is called. |
StartTlsResponse |
startTls(LdapContext ctx)
This will attempt to StartTLS with the supplied LdapContext. |
void |
stopTls(StartTlsResponse tls)
This will attempt to StopTLS with the supplied
StartTlsResponse. |
| Methods inherited from class edu.vt.middleware.ldap.handler.AbstractConnectionHandler |
|---|
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 |
|---|
public TlsConnectionHandler()
public TlsConnectionHandler(LdapConfig lc)
TlsConnectionHandler with the supplied ldap
config.
lc - ldap configpublic TlsConnectionHandler(TlsConnectionHandler ch)
TlsConnectionHandler.
ch - to copy properties from| Method Detail |
|---|
public boolean getStopTlsOnClose()
StartTlsResponse.close() when close() is called.
public void setStopTlsOnClose(boolean b)
StartTlsResponse.close() when close()
is called.
b - stop TLS on closepublic StartTlsResponse getStartTlsResponse()
AbstractConnectionHandler.connect(String, Object).
protected void connectInternal(String authtype,
String dn,
Object credential,
Hashtable<String,Object> env)
throws NamingException
connectInternal in class DefaultConnectionHandlerauthtype - 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 established
public void close()
throws NamingException
close in interface ConnectionHandlerclose in class AbstractConnectionHandlerNamingException - if an LDAP error occurs
public StartTlsResponse startTls(LdapContext ctx)
throws NamingException
LdapContext.
ctx - LdapContext
StartTlsResponse
NamingException - if an error occurs while requesting an extended
operation
public void stopTls(StartTlsResponse tls)
throws NamingException
StartTlsResponse.
tls - StartTlsResponse
NamingException - if an error occurs while closing the TLS
connectionpublic TlsConnectionHandler newInstance()
newInstance in interface ConnectionHandlernewInstance in class DefaultConnectionHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||