Class NetworkBindingOperation<U>
java.lang.Object
io.kroxylicious.proxy.internal.net.NetworkBindingOperation<U>
- Type Parameters:
U- the type yielded by the future signalling the completion of the binding operation.
- Direct Known Subclasses:
NetworkBindRequest,NetworkUnbindRequest
Abstract encapsulation of a network binding operation.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNetworkBindingOperation(boolean tls) Creates a NetworkBindingOperation with given TLS mode. -
Method Summary
Modifier and TypeMethodDescriptionabstract CompletableFuture<U> The future that signals the completion of the network binding operation.abstract voidperformBindingOperation(io.netty.bootstrap.ServerBootstrap serverBootstrap, ExecutorService executorService) Performs the binding operation.abstract intport()The port associated with the binding operation.booleantls()Indicates whether the binding is to be used for TLS.
-
Field Details
-
tls
protected final boolean tls
-
-
Constructor Details
-
NetworkBindingOperation
protected NetworkBindingOperation(boolean tls) Creates a NetworkBindingOperation with given TLS mode.- Parameters:
tls- Indicates whether the port is to be used for TLS.
-
-
Method Details
-
tls
public boolean tls()Indicates whether the binding is to be used for TLS.- Returns:
- tls flag
-
port
public abstract int port()The port associated with the binding operation.- Returns:
- port
-
getFuture
The future that signals the completion of the network binding operation.- Returns:
- completable future
-
performBindingOperation
public abstract void performBindingOperation(io.netty.bootstrap.ServerBootstrap serverBootstrap, ExecutorService executorService) Performs the binding operation. Implementations must organise of the future provided bygetFuture()to beCompletableFuture.complete(Object)when the binding operation completes successfully. If the binding operations fails, the future must beCompletableFuture.completeExceptionally(Throwable).
If the implementation makes use ofFutureListener, the implementation of theGenericFutureListener.operationComplete(Future)method must delegate work to the executorService rather than occupy the Netty owned worker thread.- Parameters:
serverBootstrap- server bootstrap on which the binding operations must be performed.executorService- executor service
-