@FunctionalInterface public interface ConnectionAcceptor extends AsyncCloseable
| Modifier and Type | Field and Description |
|---|---|
static ConnectionAcceptor |
ACCEPT_ALL
ACCEPT all connections.
|
| Modifier and Type | Method and Description |
|---|---|
Completable |
accept(ConnectionContext context)
Evaluate the passed
ConnectionContext to accept or reject. |
default ConnectionAcceptor |
append(ConnectionAcceptor after)
Returns a composed
ConnectionAcceptor that first applies this ConnectionAcceptor, and if
this is successful then applies after ConnectionAcceptor. |
default Completable |
closeAsync()
Used to close/shutdown a resource.
|
closeAsyncGracefullystatic final ConnectionAcceptor ACCEPT_ALL
Completable accept(ConnectionContext context)
ConnectionContext to accept or reject. If the returned Completable terminates
successfully then the passed ConnectionContext will be accepted, otherwise rejected.context - the ConnectionContext to evaluate.Completable, which when terminated successfully, the passed ConnectionContext
is accepted, otherwise rejected.default ConnectionAcceptor append(ConnectionAcceptor after)
ConnectionAcceptor that first applies this ConnectionAcceptor, and if
this is successful then applies after ConnectionAcceptor.
The order of execution of these filters are in order of append. If 3 filters are added as follows:
this.append(filter1).append(filter2).append(filter3)
accepting a connection by a filter wrapped by this filter chain, the order of invocation of these filters will
be:
this => filter1 => filter2 => filter3
after - the ConnectionAcceptor to apply after this ConnectionAcceptor is
appliedConnectionAcceptor that first applies this ConnectionAcceptor, and if
this is successful then applies after ConnectionAcceptor.default Completable closeAsync()
AsyncCloseablecloseAsync in interface AsyncCloseableCompletableSource that is notified once the close is complete.