Package org.ldaptive
Interface Connection
-
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
NettyConnection
,TransportConnection
public interface Connection extends AutoCloseable
Interface for connection implementations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
close()
void
close(RequestControl... controls)
Closes the connection.LdapURL
getLdapURL()
Returns the URL that was selected for this connection.boolean
isOpen()
Returns whether this connection is open.void
open()
Opens the connection.void
operation(AbandonRequest request)
Executes an abandon operation.OperationHandle<AddRequest,AddResponse>
operation(AddRequest request)
Creates a handle for an add operation.OperationHandle<BindRequest,BindResponse>
operation(BindRequest request)
Creates a handle for a bind operation.CompareOperationHandle
operation(CompareRequest request)
Creates a handle for a compare operation.OperationHandle<DeleteRequest,DeleteResponse>
operation(DeleteRequest request)
Creates a handle for a delete operation.ExtendedOperationHandle
operation(ExtendedRequest request)
Creates a handle for an extended operation.OperationHandle<ModifyDnRequest,ModifyDnResponse>
operation(ModifyDnRequest request)
Creates a handle for a modify dn operation.OperationHandle<ModifyRequest,ModifyResponse>
operation(ModifyRequest request)
Creates a handle for a modify operation.BindResponse
operation(DefaultSaslClientRequest request)
Returns the result of a SASL request that requires use of the default SASL client.BindResponse
operation(SaslClientRequest request)
Returns the result of a SASL request that requires use of a generic SASL client.SearchOperationHandle
operation(SearchRequest request)
Creates a handle for a search operation.
-
-
-
Method Detail
-
operation
void operation(AbandonRequest request)
Executes an abandon operation. Clients should execute abandons usingOperationHandle.abandon()
.- Parameters:
request
- abandon request
-
operation
OperationHandle<AddRequest,AddResponse> operation(AddRequest request)
Creates a handle for an add operation.- Parameters:
request
- add request- Returns:
- operation handle
-
operation
OperationHandle<BindRequest,BindResponse> operation(BindRequest request)
Creates a handle for a bind operation. Since clients must not send requests while a bind is in progress, some methods may not be supported on the operation handle.- Parameters:
request
- bind request- Returns:
- operation handle
-
operation
CompareOperationHandle operation(CompareRequest request)
Creates a handle for a compare operation.- Parameters:
request
- compare request- Returns:
- compare operation handle
-
operation
OperationHandle<DeleteRequest,DeleteResponse> operation(DeleteRequest request)
Creates a handle for a delete operation.- Parameters:
request
- delete request- Returns:
- operation handle
-
operation
ExtendedOperationHandle operation(ExtendedRequest request)
Creates a handle for an extended operation.- Parameters:
request
- extended request- Returns:
- extended operation handle
-
operation
OperationHandle<ModifyRequest,ModifyResponse> operation(ModifyRequest request)
Creates a handle for a modify operation.- Parameters:
request
- modify request- Returns:
- operation handle
-
operation
OperationHandle<ModifyDnRequest,ModifyDnResponse> operation(ModifyDnRequest request)
Creates a handle for a modify dn operation.- Parameters:
request
- modify dn request- Returns:
- operation handle
-
operation
SearchOperationHandle operation(SearchRequest request)
Creates a handle for a search operation.- Parameters:
request
- search request- Returns:
- search operation handle
-
operation
BindResponse operation(SaslClientRequest request) throws LdapException
Returns the result of a SASL request that requires use of a generic SASL client.- Parameters:
request
- SASL client request- Returns:
- operation result
- Throws:
LdapException
- if the operation fails or another bind is in progress
-
operation
BindResponse operation(DefaultSaslClientRequest request) throws LdapException
Returns the result of a SASL request that requires use of the default SASL client. This includes CRAM-MD5, DIGEST-MD5, and GSS-API.- Parameters:
request
- default SASL client request- Returns:
- operation result
- Throws:
LdapException
- if the operation fails or another bind is in progress
-
getLdapURL
LdapURL getLdapURL()
Returns the URL that was selected for this connection. The existence of this value does not indicate a current established connection.- Returns:
- LDAP URL
-
isOpen
boolean isOpen()
Returns whether this connection is open.- Returns:
- whether this connection is open
-
open
void open() throws LdapException
Opens the connection.- Throws:
LdapException
- if an error occurs opening the connection
-
close
default void close()
- Specified by:
close
in interfaceAutoCloseable
-
close
void close(RequestControl... controls)
Closes the connection.- Parameters:
controls
- to send when closing the connection
-
-