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 java.lang.ObjectNetty listener configuration.- Since:
- 3.5.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNettyHttpServerConfiguration.NettyListenerConfiguration.FamilyAddress family enum.
-
Constructor Summary
Constructors Constructor Description NettyListenerConfiguration()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NettyHttpServerConfiguration.NettyListenerConfigurationcreateTcp(java.lang.String host, int port, boolean ssl)Create a TCP listener configuration.NettyHttpServerConfiguration.NettyListenerConfiguration.FamilygetFamily()The address family of this listener.java.lang.StringgetHost()For TCP listeners, the host to bind to, ornullto bind to all hosts.java.lang.StringgetPath()For UNIX domain sockets, the path of the socket.intgetPort()The TCP port to bind to.booleanisExposeDefaultRoutes()Whether to expose default routes on this listener.booleanisSsl()Whether to enable SSL on this listener.voidsetExposeDefaultRoutes(boolean exposeDefaultRoutes)Whether to expose default routes on this listener.voidsetFamily(NettyHttpServerConfiguration.NettyListenerConfiguration.Family family)The address family of this listener.voidsetHost(java.lang.String host)For TCP listeners, the host to bind to, ornullto bind to all hosts.voidsetPath(java.lang.String path)For UNIX domain sockets, the path of the socket.voidsetPort(int port)The TCP port to bind to.voidsetSsl(boolean ssl)Whether to enable SSL on this listener.
-
-
-
Method Detail
-
createTcp
@Internal public static NettyHttpServerConfiguration.NettyListenerConfiguration createTcp(@Nullable java.lang.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
public NettyHttpServerConfiguration.NettyListenerConfiguration.Family getFamily()
The address family of this listener.- Returns:
- The address family of this listener.
-
setFamily
public void setFamily(@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
@Nullable public java.lang.String getHost()
For TCP listeners, the host to bind to, ornullto bind to all hosts.- Returns:
- For TCP listeners, the host to bind to, or
nullto bind to all hosts.
-
setHost
public void setHost(@Nullable java.lang.String host)For TCP listeners, the host to bind to, ornullto bind to all hosts.- Parameters:
host- For TCP listeners, the host to bind to, ornullto bind to all hosts.
-
getPort
public int getPort()
The TCP port to bind to. May be-1to bind to a random port.- Returns:
- The TCP port to bind to. May be
-1to bind to a random port.
-
setPort
public void setPort(int port)
The TCP port to bind to. May be-1to bind to a random port.- Parameters:
port- The TCP port to bind to. May be-1to bind to a random port.
-
getPath
public java.lang.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(java.lang.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.
-
-