public final class Connections extends Object
Modifier and Type | Method and Description |
---|---|
static Connection |
newInternalConnection(BiFunction<Integer,Request,Flowable<Response>> requestHandler)
Creates a new
Connection which will route requests to the provided requestHandler . |
static ConnectionFactory |
newInternalConnectionFactory(BiFunction<Integer,Request,Flowable<Response>> requestHandler)
Creates a new
ConnectionFactory which will route requests to the provided requestHandler . |
static Connection |
uncloseable(Connection connection)
Returns an uncloseable view of the provided connection.
|
static ConnectionFactory |
uncloseable(ConnectionFactory factory)
Returns an uncloseable view of the provided connection factory.
|
public static Connection newInternalConnection(BiFunction<Integer,Request,Flowable<Response>> requestHandler)
Connection
which will route requests to the provided requestHandler
.
When processing requests, requestHandler
implementations 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 requestHandler
implementations 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.
requestHandler
- The request handler which will be used for all client connections.NullPointerException
- If requestHandler
was null
.public static ConnectionFactory newInternalConnectionFactory(BiFunction<Integer,Request,Flowable<Response>> requestHandler)
ConnectionFactory
which will route requests to the provided requestHandler
.
When processing requests, requestHandler
implementations 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 requestHandler
implementations 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.
requestHandler
- The request handler which will be used for all client connections.NullPointerException
- If requestHandler
was null
.public static Connection uncloseable(Connection connection)
Connection.close()
or
Connection.close(UnbindRequest, String)
will be ignored.connection
- The connection whose close
methods are to be disabled.public static ConnectionFactory uncloseable(ConnectionFactory factory)
ConnectionFactory.close()
will be ignored.factory
- The connection factory whose close
method is to be disabled.Copyright 2010-2022 ForgeRock AS.