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
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Address family enum. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreate a TCP listener configuration.The address family of this listener.getHost()
For TCP listeners, the host to bind to, ornull
to bind to all hosts.getPath()
For UNIX domain sockets, the path of the socket.int
getPort()
The TCP port to bind to.boolean
Whether to expose default routes on this listener.boolean
isSsl()
Whether to enable SSL on this listener.void
setExposeDefaultRoutes
(boolean exposeDefaultRoutes) Whether to expose default routes on this listener.void
The address family of this listener.void
For TCP listeners, the host to bind to, ornull
to bind to all hosts.void
For UNIX domain sockets, the path of the socket.void
setPort
(int port) The TCP port to bind to.void
setSsl
(boolean ssl) Whether to enable SSL on this listener.
-
Constructor Details
-
NettyListenerConfiguration
public NettyListenerConfiguration()
-
-
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 toport
- The port to bind tossl
- Whether to enable SSL- Returns:
- The configuration with the given settings
-
getFamily
The address family of this listener.- Returns:
- The address family of this listener.
-
setFamily
public void setFamily(@NonNull @NonNull NettyHttpServerConfiguration.NettyListenerConfiguration.Family family) 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 requiresSslConfiguration.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 requiresSslConfiguration.isEnabled()
to be set.- Parameters:
ssl
- Whether to enable SSL on this listener.
-
getHost
For TCP listeners, the host to bind to, ornull
to bind to all hosts.- Returns:
- For TCP listeners, the host to bind to, or
null
to bind to all hosts.
-
setHost
For TCP listeners, the host to bind to, ornull
to bind to all hosts.- Parameters:
host
- For TCP listeners, the host to bind to, ornull
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
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
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
Whether to expose default routes on this listener.- Returns:
- Whether to expose default routes on this listener.
-
setExposeDefaultRoutes
Whether to expose default routes on this listener.- Parameters:
exposeDefaultRoutes
- Whether to expose default routes on this listener.
-