Class NettyHttpServerConfiguration.NettyListenerConfiguration

java.lang.Object
io.micronaut.http.server.netty.configuration.NettyHttpServerConfiguration.NettyListenerConfiguration
Enclosing class:
NettyHttpServerConfiguration

@EachProperty("listeners") public static final class NettyHttpServerConfiguration.NettyListenerConfiguration extends Object
Netty listener configuration.
Since:
3.5.0
Author:
yawkat
  • Constructor Details

  • Method Details

    • createTcp

      @Internal public static NettyHttpServerConfiguration.NettyListenerConfiguration createTcp(@Nullable @Nullable String host, int port, boolean ssl)
      Create a TCP listener configuration.
      Parameters:
      host - The host to bind to
      port - The port to bind to
      ssl - Whether to enable SSL
      Returns:
      The configuration with the given settings
    • getName

      public String getName()
      Name of the listener.
      Returns:
      Name of the listener
    • getFamily

      The address family of this listener.
      Returns:
      The address family of this listener.
    • setFamily

      The address family of this listener.
      Parameters:
      family - The address family of this listener.
    • isSsl

      public boolean isSsl()
      Whether to enable SSL on this listener. Also requires SslConfiguration.isEnabled() to be set.
      Returns:
      Whether to enable SSL on this listener.
    • setSsl

      public void setSsl(boolean ssl)
      Whether to enable SSL on this listener. Also requires SslConfiguration.isEnabled() to be set.
      Parameters:
      ssl - Whether to enable SSL on this listener.
    • getHost

      @Nullable public @Nullable String getHost()
      For TCP listeners, the host to bind to, or null to bind to all hosts.
      Returns:
      For TCP listeners, the host to bind to, or null to bind to all hosts.
    • setHost

      public void setHost(@Nullable @Nullable String host)
      For TCP listeners, the host to bind to, or null to bind to all hosts.
      Parameters:
      host - For TCP listeners, the host to bind to, or null to bind to all hosts.
    • getPort

      public int getPort()
      The TCP port to bind to. May be -1 to bind to a random port.
      Returns:
      The TCP port to bind to. May be -1 to bind to a random port.
    • setPort

      public void setPort(int port)
      The TCP port to bind to. May be -1 to bind to a random port.
      Parameters:
      port - The TCP port to bind to. May be -1 to bind to a random port.
    • getPath

      public String getPath()
      For UNIX domain sockets, the path of the socket. For abstract domain sockets, this should start with a NUL byte.
      Returns:
      For UNIX domain sockets, the path of the socket. For abstract domain sockets, this should start with a NUL byte.
    • setPath

      public void setPath(String path)
      For UNIX domain sockets, the path of the socket. For abstract domain sockets, this should start with a NUL byte.
      Parameters:
      path - For UNIX domain sockets, the path of the socket. For abstract domain sockets, this should start with a NUL byte.
    • isExposeDefaultRoutes

      @Internal public boolean isExposeDefaultRoutes()
      Whether to expose default routes on this listener.
      Returns:
      Whether to expose default routes on this listener.
    • setExposeDefaultRoutes

      @Internal public void setExposeDefaultRoutes(boolean exposeDefaultRoutes)
      Whether to expose default routes on this listener.
      Parameters:
      exposeDefaultRoutes - Whether to expose default routes on this listener.
    • isSupportGracefulShutdown

      public boolean isSupportGracefulShutdown()
      If true (the default), this listener will stop accepting new connections and terminate any existing ones when a graceful shutdown is initiated. By setting this to false you can ignore the graceful shutdown, e.g. to keep a management port up while the shutdown of other listeners is in progress.
      Returns:
      Whether to support shutting down gracefully
    • setSupportGracefulShutdown

      public void setSupportGracefulShutdown(boolean supportGracefulShutdown)
      If true (the default), this listener will stop accepting new connections and terminate any existing ones when a graceful shutdown is initiated. By setting this to false you can ignore the graceful shutdown, e.g. to keep a management port up while the shutdown of other listeners is in progress.
      Parameters:
      supportGracefulShutdown - Whether to support shutting down gracefully
    • getFd

      public Integer getFd()
      The fixed file descriptor for this listener, or null if a new file descriptor should be opened (the default).
      Returns:
      The file descriptor
    • setFd

      public void setFd(Integer fd)
      The fixed file descriptor for this listener, or null if a new file descriptor should be opened (the default).
      Parameters:
      fd - The file descriptor
    • isBind

      public boolean isBind()
      Whether the server should bind to the socket. true by default. If set to false, the socket must already be bound and listening.
      Returns:
      Whether to bind to the socket
    • setBind

      public void setBind(boolean bind)
      Whether the server should bind to the socket. true by default. If set to false, the socket must already be bound and listening.
      Parameters:
      bind - Whether to bind to the socket
    • isServerSocket

      public boolean isServerSocket()
      Whether to create a server socket. This is on by default. Turning it off only makes sense in combination with acceptedFd.
      Returns:
      true iff a server socket should be created
    • setServerSocket

      public void setServerSocket(boolean serverSocket)
      Whether to create a server socket. This is on by default. Turning it off only makes sense in combination with acceptedFd.
      Parameters:
      serverSocket - true iff a server socket should be created
    • getAcceptedFd

      public Integer getAcceptedFd()
      An already accepted socket fd that should be registered to this listener.
      Returns:
      The fd to register
    • setAcceptedFd

      public void setAcceptedFd(Integer acceptedFd)
      An already accepted socket fd that should be registered to this listener.
      Parameters:
      acceptedFd - The fd to register