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

public abstract class NetworkBindingOperation<U> extends Object
Abstract encapsulation of a network binding operation.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final boolean
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Creates a NetworkBindingOperation with given TLS mode.
  • Method Summary

    Modifier and Type
    Method
    Description
    The future that signals the completion of the network binding operation.
    abstract void
    performBindingOperation(io.netty.bootstrap.ServerBootstrap serverBootstrap, ExecutorService executorService)
    Performs the binding operation.
    abstract int
    The port associated with the binding operation.
    boolean
    tls()
    Indicates whether the binding is to be used for TLS.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public abstract CompletableFuture<U> 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 by getFuture() to be CompletableFuture.complete(Object) when the binding operation completes successfully. If the binding operations fails, the future must be CompletableFuture.completeExceptionally(Throwable).
      If the implementation makes use of FutureListener, the implementation of the GenericFutureListener.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