Class AbstractIPBabelChannelBuilder<T extends BabelChannelBuilder>

java.lang.Object
pt.unl.fct.di.novasys.babel2.channels.AbstractBabelChannelBuilder<T>
pt.unl.fct.di.novasys.babel2.channels.AbstractIPBabelChannelBuilder<T>
Type Parameters:
T - the concrete builder subtype for fluent method chaining
All Implemented Interfaces:
BabelChannelBuilder
Direct Known Subclasses:
LegacySimpleServerBabelChannelBuilder, QUICBabelChannelBuilder, TCPBabelChannelBuilder, TLSBabelChannelBuilder, UDPBabelChannelBuilder

public abstract class AbstractIPBabelChannelBuilder<T extends BabelChannelBuilder> extends AbstractBabelChannelBuilder<T>
Base builder for channel implementations operating over IP networks.

Provides common configuration options such as binding socket addresses, Netty event loop groups, and connection-up notification delays.

  • Field Details

    • DEFAULT_CONNECTION_UP_DELAY

      public static final long DEFAULT_CONNECTION_UP_DELAY
      Default delay in milliseconds before dispatching connection-up notifications.
      See Also:
    • DEFAULT_CONNECTION_UP_DELAY_UNIT

      public static final TimeUnit DEFAULT_CONNECTION_UP_DELAY_UNIT
      Default time unit for DEFAULT_CONNECTION_UP_DELAY.
  • Constructor Details

    • AbstractIPBabelChannelBuilder

      protected AbstractIPBabelChannelBuilder()
      Initializes a new IP channel builder with default settings.
  • Method Details

    • setBindingAddress

      public final T setBindingAddress(InetSocketAddress bindingAddress)
      Sets the local IP socket address to which the channel should bind.
      Parameters:
      bindingAddress - the socket address to bind to
      Returns:
      this builder instance
    • getBindingAddress

      protected final InetSocketAddress getBindingAddress()
      Returns the currently configured binding address.
      Returns:
      the local binding address
    • setEventLoopGroup

      public final T setEventLoopGroup(io.netty.channel.EventLoopGroup eventLoopGroup)
      Configures the Netty EventLoopGroup used for network I/O.
      Parameters:
      eventLoopGroup - the custom event loop group, or null to allocate a default group
      Returns:
      this builder instance
    • getEventLoopGroup

      protected final io.netty.channel.EventLoopGroup getEventLoopGroup()
      Returns the configured event loop group, initializing a default one via BabelIpUtils.createLoopGroup() if none has been set.
      Returns:
      the active event loop group
    • setConnectionUpDelay

      public final T setConnectionUpDelay(long delay, TimeUnit unit)
      Sets the delay and unit before notifying the runtime that a connection is fully up.
      Parameters:
      delay - the delay duration
      unit - the time unit of the delay
      Returns:
      this builder instance
    • setConnectionUpDelay

      public final T setConnectionUpDelay(long delayMillis)
      Sets the delay in milliseconds before notifying the runtime that a connection is fully up.
      Parameters:
      delayMillis - the delay duration in milliseconds
      Returns:
      this builder instance
    • getConnectionUpDelay

      protected final long getConnectionUpDelay()
      Returns the configured connection up delay value.
      Returns:
      the connection up delay
    • getConnectionUpDelayUnit

      protected final TimeUnit getConnectionUpDelayUnit()
      Returns the time unit of the connection up delay.
      Returns:
      the connection up delay time unit