public class ServerOptions extends NettyOptions<ServerBootstrap,ServerOptions>
DEFAULT_PORT| Modifier | Constructor and Description |
|---|---|
protected |
ServerOptions()
Build a new
ServerBootstrap. |
protected |
ServerOptions(ServerBootstrap serverBootstrap)
Apply common option via super constructor then apply
defaultServerOptions(ServerBootstrap)
to the passed bootstrap. |
protected |
ServerOptions(ServerOptions options)
Deep-copy all references from the passed options into this new
ServerOptions instance. |
| Modifier and Type | Method and Description |
|---|---|
<T> ServerOptions |
attr(AttributeKey<T> key,
T value)
Attribute default attribute to the future
Channel connection. |
static ServerOptions |
create()
Create a new server builder
|
ServerOptions |
duplicate()
Return a copy of all options and references such as
NettyOptions.onChannelInit(Predicate). |
ServerBootstrap |
get() |
SocketAddress |
getAddress()
Return a new eventual
SocketAddress |
ServerOptions |
listen(InetSocketAddress listenAddress)
The
InetSocketAddress on which this server should listen. |
ServerOptions |
listen(int port)
The port on which this server should listen, assuming it should bind to all available addresses.
|
ServerOptions |
listen(String host)
The host on which this server should listen, port will be resolved on bind.
|
ServerOptions |
listen(String host,
int port)
The host and port on which this server should listen.
|
<T> ServerOptions |
option(ChannelOption<T> key,
T value)
Set a
ChannelOption value for low level connection settings like
SO_TIMEOUT or SO_KEEPALIVE. |
<T> ServerOptions |
selectorAttr(AttributeKey<T> key,
T value)
Attribute default attribute to the future
Channel connection. |
<T> ServerOptions |
selectorOption(ChannelOption<T> key,
T value)
Set a
ChannelOption value for low level selector channel settings like
SO_TIMEOUT or SO_KEEPALIVE. |
ServerOptions |
sslSelfSigned()
Enable SSL service with a self-signed certificate
|
ServerOptions |
sslSelfSigned(java.util.function.Consumer<? super SslContextBuilder> configurator)
Enable SSL service with a self-signed certificate and allows extra
parameterization of the self signed
SslContextBuilder. |
afterChannelInit, afterChannelInit, channelGroup, defaultSslContext, eventLoopGroup, getLoopResources, getSslHandler, loopResources, onChannelInit, onChannelInit, preferNative, preferNative, sslContext, sslHandshakeTimeout, sslHandshakeTimeoutMillis, toStringprotected ServerOptions()
ServerBootstrap.protected ServerOptions(ServerBootstrap serverBootstrap)
defaultServerOptions(ServerBootstrap)
to the passed bootstrap.serverBootstrap - the server bootstrap reference to useprotected ServerOptions(ServerOptions options)
ServerOptions instance.options - the source options to duplicatepublic static ServerOptions create()
public <T> ServerOptions attr(AttributeKey<T> key, T value)
Channel connection. They will
be available via NettyInbound.attr(AttributeKey).attr in class NettyOptions<ServerBootstrap,ServerOptions>T - the attribute typekey - the attribute keyvalue - the attribute valueServerBootstrap.childAttr(AttributeKey, Object)public ServerOptions duplicate()
NettyOptionsNettyOptions.onChannelInit(Predicate). Further option uses on the returned builder will
be fully isolated from this option builder.duplicate in class NettyOptions<ServerBootstrap,ServerOptions>public ServerBootstrap get()
get in interface java.util.function.Supplier<ServerBootstrap>get in class NettyOptions<ServerBootstrap,ServerOptions>public final SocketAddress getAddress()
NettyOptionsSocketAddressgetAddress in class NettyOptions<ServerBootstrap,ServerOptions>SocketAddress or nullpublic ServerOptions listen(int port)
port - The port to listen on.public ServerOptions listen(String host)
host - The host to bind to.public ServerOptions listen(String host, int port)
host - The host to bind to.port - The port to listen on.public ServerOptions listen(InetSocketAddress listenAddress)
InetSocketAddress on which this server should listen.listenAddress - the listen addresspublic <T> ServerOptions option(ChannelOption<T> key, T value)
ChannelOption value for low level connection settings like
SO_TIMEOUT or SO_KEEPALIVE. This will apply to each new channel from remote
peer.option in class NettyOptions<ServerBootstrap,ServerOptions>T - the option typekey - the option keythisServerBootstrap.childOption(ChannelOption, Object)public <T> ServerOptions selectorAttr(AttributeKey<T> key, T value)
Channel connection. They will
be available via NettyInbound.attr(AttributeKey).T - the attribute typekey - the attribute keyvalue - the attribute valueAbstractBootstrap.attr(AttributeKey, Object)public <T> ServerOptions selectorOption(ChannelOption<T> key, T value)
ChannelOption value for low level selector channel settings like
SO_TIMEOUT or SO_KEEPALIVE. This will apply to each new channel from remote
peer.T - the option typekey - the option keythisServerBootstrap.childOption(ChannelOption, Object)public ServerOptions sslSelfSigned()
thispublic ServerOptions sslSelfSigned(java.util.function.Consumer<? super SslContextBuilder> configurator)
SslContextBuilder. The builder is
then used to invoke NettyOptions.sslContext(SslContext).configurator - the builder callback to setup the self-signed SslContextBuilderthis