Class NettyServerFactory

    • Constructor Detail

      • NettyServerFactory

        public NettyServerFactory()
    • Method Detail

      • isDisableHeartbeats

        public boolean isDisableHeartbeats()
        Returns true if heartbeats are disabled (see setDisableHeartbeats(boolean)).
        Returns:
        true if heartbeats are disabled.
      • setDisableHeartbeats

        public void setDisableHeartbeats​(boolean disableHeartbeats)
        Enabled/disabled heartbeats support.

        If heartbeats are disabled then NetworkServer will not use heartbeats to keep connections alive. In such case it is up to the application to manage heartbeats and perform detection of broken connections.

        Default value of this parameter is false (i.e. heartbeats are enabled).

        Parameters:
        disableHeartbeats - true if heartbeats must be disabled.
      • withDisableHeartbeats

        public NettyServerFactory withDisableHeartbeats​(boolean disableHeartbeats)
        Fluent-style version of setDisableHeartbeats(boolean).
        Parameters:
        disableHeartbeats - true if heartbeats must be disabled.
        Returns:
        This instance.
      • setHandlers

        public void setHandlers​(List<NettyServerHandlerConfig<?>> handlers)
        Sets the list of server connection handlers.
        Parameters:
        handlers - Server handlers.
      • getAcceptorEventLoop

        public io.netty.channel.EventLoopGroup getAcceptorEventLoop()
        Returns the event loop group that is responsible for accepting new connections (see setAcceptorEventLoop(EventLoopGroup)).
        Returns:
        Event loop group for accepting new connections.
      • setAcceptorEventLoop

        public void setAcceptorEventLoop​(io.netty.channel.EventLoopGroup acceptorEventLoop)
        Sets the event loop group that will be responsible for accepting new connections.
        Parameters:
        acceptorEventLoop - Event loop group for accepting new connections.
      • withAcceptorEventLoop

        public NettyServerFactory withAcceptorEventLoop​(io.netty.channel.EventLoopGroup acceptorEventLoop)
        Fluent-style version of setAcceptorEventLoop(EventLoopGroup).
        Parameters:
        acceptorEventLoop - Event loop group for accepting new connections.
        Returns:
        This instance.
      • getWorkerEventLoop

        public io.netty.channel.EventLoopGroup getWorkerEventLoop()
        Returns the event loop group that is responsible for handling messaging operations (see setWorkerEventLoop(EventLoopGroup)).
        Returns:
        Event loop group for messaging operations handling.
      • setWorkerEventLoop

        public void setWorkerEventLoop​(io.netty.channel.EventLoopGroup workerEventLoop)
        Sets the event loop group that will be responsible for handling messaging operations.
        Parameters:
        workerEventLoop - Event loop group for messaging operations handling.
      • withWorkerEventLoop

        public NettyServerFactory withWorkerEventLoop​(io.netty.channel.EventLoopGroup workerEventLoop)
        Fluent-style version of setWorkerEventLoop(EventLoopGroup).
        Parameters:
        workerEventLoop - Event loop group for messaging operations handling.
        Returns:
        This instance.
      • getSsl

        public io.netty.handler.ssl.SslContext getSsl()
        Returns the SSL context (see setSsl(SslContext)).
        Returns:
        SSL context.
      • setSsl

        public void setSsl​(io.netty.handler.ssl.SslContext ssl)
        Sets the SSL context that should be used to secure all network communications.

        This parameter is optional and if not specified then no encryption will be applied.

        Note: If SSL is configured for the server then it should be configured on the client side too (see NettyClientFactory.setSsl(SslContext)).

        Parameters:
        ssl - SSL context.
      • withSsl

        public NettyServerFactory withSsl​(io.netty.handler.ssl.SslContext ssl)
        Fluent-style version of setSsl(SslContext).
        Parameters:
        ssl - SSL context.
        Returns:
        SSL context.
      • setMetrics

        public void setMetrics​(NettyMetricsFactory metrics)
        Sets the metrics factory.

        This parameter is optional and if not specified then no metrics will be collected by the NetworkServer.

        Parameters:
        metrics - Metrics factory.