Class Connections
-
Method Summary
Modifier and TypeMethodDescriptionstatic ConnectionnewInternalConnection(BiFunction<Integer, Request, Flowable<Response>> requestHandler) Creates a newConnectionwhich will route requests to the providedrequestHandler.static ConnectionFactorynewInternalConnectionFactory(BiFunction<Integer, Request, Flowable<Response>> requestHandler) Creates a newConnectionFactorywhich will route requests to the providedrequestHandler.static Connectionuncloseable(Connection connection) Returns an uncloseable view of the provided connection.static ConnectionFactoryuncloseable(ConnectionFactory factory) Returns an uncloseable view of the provided connection factory.
-
Method Details
-
newInternalConnection
public static Connection newInternalConnection(BiFunction<Integer, Request, Flowable<Response>> requestHandler) Creates a newConnectionwhich will route requests to the providedrequestHandler.When processing requests,
requestHandlerimplementations are passed a pseudo request ID which is incremented for each successive internal request on a per client connection basis. The request ID may be useful for logging purposes.An internal connection does not require
requestHandlerimplementations to return a result when processing requests. However, it is recommended that implementations do always return results even for abandoned requests. This is because application client threads may block indefinitely waiting for results.- Parameters:
requestHandler- The request handler which will be used for all client connections.- Returns:
- The new internal connection.
- Throws:
NullPointerException- IfrequestHandlerwasnull.
-
newInternalConnectionFactory
public static ConnectionFactory newInternalConnectionFactory(BiFunction<Integer, Request, Flowable<Response>> requestHandler) Creates a newConnectionFactorywhich will route requests to the providedrequestHandler.When processing requests,
requestHandlerimplementations are passed a pseudo request ID which is incremented for each successive internal request on a per client connection basis. The request ID may be useful for logging purposes.An internal connection does not require
requestHandlerimplementations to return a result when processing requests. However, it is recommended that implementations do always return results even for abandoned requests. This is because application client threads may block indefinitely waiting for results.- Parameters:
requestHandler- The request handler which will be used for all client connections.- Returns:
- The new internal LDAP client.
- Throws:
NullPointerException- IfrequestHandlerwasnull.
-
uncloseable
Returns an uncloseable view of the provided connection. Attempts to callConnection.close()orConnection.close(UnbindRequest, String)will be ignored.- Parameters:
connection- The connection whoseclosemethods are to be disabled.- Returns:
- An uncloseable view of the provided connection.
-
uncloseable
Returns an uncloseable view of the provided connection factory. Attempts to callConnectionFactory.close()will be ignored.- Parameters:
factory- The connection factory whoseclosemethod is to be disabled.- Returns:
- An uncloseable view of the provided connection factory.
-