org.ldaptive
Interface Connection

All Known Implementing Classes:
DefaultConnectionFactory.DefaultConnection

public interface Connection

Interface for ldap connection implementations.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Method Summary
 void close()
          This will close the connection to the LDAP.
 void close(RequestControl[] controls)
          This will close the connection to the LDAP using the supplied controls.
 ConnectionConfig getConnectionConfig()
          Returns the connection config for this connection.
 ProviderConnection getProviderConnection()
          Returns the provider connection to invoke the provider specific implementation.
 boolean isOpen()
          Returns whether open(BindRequest) was successfully invoked on this connection and close() and not been invoked.
 Response<Void> open()
          This will establish a connection to the LDAP.
 Response<Void> open(BindRequest request)
          This will establish a connection to the LDAP using the supplied bind request.
 Response<Void> reopen()
          This will close an existing connection to the LDAP and establish a new connection to the LDAP.
 Response<Void> reopen(BindRequest request)
          This will close an existing connection to the LDAP and establish a new connection to the LDAP using the supplied bind request.
 

Method Detail

getConnectionConfig

ConnectionConfig getConnectionConfig()
Returns the connection config for this connection. The config may be read-only.

Returns:
connection config

open

Response<Void> open()
                    throws LdapException
This will establish a connection to the LDAP. This connection should be closed using close().

Returns:
response associated with the ConnectionInitializer or an empty response if no connection initializer was configured
Throws:
IllegalStateException - if the connection is already open
LdapException - if the LDAP cannot be reached

open

Response<Void> open(BindRequest request)
                    throws LdapException
This will establish a connection to the LDAP using the supplied bind request. This connection should be closed using close().

Parameters:
request - containing bind information
Returns:
response associated with the bind operation
Throws:
IllegalStateException - if the connection is already open
LdapException - if the LDAP cannot be reached

isOpen

boolean isOpen()
Returns whether open(BindRequest) was successfully invoked on this connection and close() and not been invoked. This method does not indicate the viability of this connection for use.

Returns:
whether this connection is open

getProviderConnection

ProviderConnection getProviderConnection()
Returns the provider connection to invoke the provider specific implementation. Must be called after a successful call to open().

Returns:
provider connection

close

void close()
This will close the connection to the LDAP.


close

void close(RequestControl[] controls)
This will close the connection to the LDAP using the supplied controls.

Parameters:
controls - request controls

reopen

Response<Void> reopen()
                      throws LdapException
This will close an existing connection to the LDAP and establish a new connection to the LDAP.

Returns:
response associated with the ConnectionInitializer or an empty response if no connection initializer was configured
Throws:
LdapException - if the LDAP cannot be reached

reopen

Response<Void> reopen(BindRequest request)
                      throws LdapException
This will close an existing connection to the LDAP and establish a new connection to the LDAP using the supplied bind request.

Parameters:
request - containing bind information
Returns:
response associated with the bind operation
Throws:
LdapException - if the LDAP cannot be reached


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