Package com.kristensoft.kdc
Class TcpServerParameters.Builder
- java.lang.Object
-
- com.kristensoft.kdc.Parameters.Builder<T>
-
- com.kristensoft.kdc.ServerParameters.Builder<TcpServerParameters.Builder>
-
- com.kristensoft.kdc.TcpServerParameters.Builder
-
- Enclosing class:
- TcpServerParameters
public static class TcpServerParameters.Builder extends ServerParameters.Builder<TcpServerParameters.Builder>
BuildsTcpServerParametersinstances.
-
-
Constructor Summary
Constructors Constructor Description Builder()Creates a builder for configuring TCP server parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TcpServerParameters.BuilderaddTcpClientEventHandler(TcpClientEventHandler handler)Adds a TCP client event handler for clients created by the server.TcpServerParameters.BuilderaddTcpClientEventHandlers(List<TcpClientEventHandler> handlers)Adds the specified TCP client event handlers for clients created by the server.TcpServerParameters.BuilderaddTcpServerEventHandler(TcpServerEventHandler handler)Adds a TCP server event handler.TcpServerParameters.BuilderaddTcpServerEventHandlers(List<TcpServerEventHandler> handlers)Adds the specified TCP server event handlers.TcpServerParametersbuild()Builds the parameters using the configuration specified by this builder.TcpServerParameters.BuilderwithClientSocketOptions(TcpClientSocketOptions options)Sets the socket options used by TCP clients created by the server.TcpServerParameters.BuilderwithServerSocketOptions(TcpServerSocketOptions options)Sets the TCP server socket options.TcpServerParameters.BuilderwithTcpClientEventHandlers(List<TcpClientEventHandler> handlers)Replaces the TCP client event handlers with the specified handlers.TcpServerParameters.BuilderwithTcpServerEventHandlers(List<TcpServerEventHandler> handlers)Replaces the TCP server event handlers with the specified handlers.-
Methods inherited from class com.kristensoft.kdc.ServerParameters.Builder
withBacklog
-
Methods inherited from class com.kristensoft.kdc.Parameters.Builder
addWhiteListEntry, registerApi, registerApi, registerApis, withAutoStart, withBindAddress, withBindAddress, withBindAddress, withCompressed, withConnectionQueuePoolSize, withCrc, withEncryptionKey, withLatencyMode, withLatencyReportingInterval, withMaxReceivedBufferSize, withMaxSendBufferSize, withSerializationFormat, withWhiteList
-
-
-
-
Method Detail
-
addTcpServerEventHandler
public TcpServerParameters.Builder addTcpServerEventHandler(TcpServerEventHandler handler)
Adds a TCP server event handler.- Parameters:
handler- the TCP server event handler to add- Returns:
- this builder
- Throws:
IllegalArgumentException- ifhandlerisnull
-
addTcpServerEventHandlers
public TcpServerParameters.Builder addTcpServerEventHandlers(List<TcpServerEventHandler> handlers)
Adds the specified TCP server event handlers.- Parameters:
handlers- the TCP server event handlers to add- Returns:
- this builder
- Throws:
IllegalArgumentException- ifhandlersisnullor contains a null handler
-
withTcpServerEventHandlers
public TcpServerParameters.Builder withTcpServerEventHandlers(List<TcpServerEventHandler> handlers)
Replaces the TCP server event handlers with the specified handlers.- Parameters:
handlers- the TCP server event handlers to use- Returns:
- this builder
- Throws:
IllegalArgumentException- ifhandlersisnullor contains a null handler
-
addTcpClientEventHandler
public TcpServerParameters.Builder addTcpClientEventHandler(TcpClientEventHandler handler)
Adds a TCP client event handler for clients created by the server.- Parameters:
handler- the TCP client event handler to add- Returns:
- this builder
- Throws:
IllegalArgumentException- ifhandlerisnull
-
addTcpClientEventHandlers
public TcpServerParameters.Builder addTcpClientEventHandlers(List<TcpClientEventHandler> handlers)
Adds the specified TCP client event handlers for clients created by the server.- Parameters:
handlers- the TCP client event handlers to add- Returns:
- this builder
- Throws:
IllegalArgumentException- ifhandlersisnullor contains a null handler
-
withTcpClientEventHandlers
public TcpServerParameters.Builder withTcpClientEventHandlers(List<TcpClientEventHandler> handlers)
Replaces the TCP client event handlers with the specified handlers.- Parameters:
handlers- the TCP client event handlers to use- Returns:
- this builder
- Throws:
IllegalArgumentException- ifhandlersisnullor contains a null handler
-
withServerSocketOptions
public TcpServerParameters.Builder withServerSocketOptions(TcpServerSocketOptions options)
Sets the TCP server socket options.- Parameters:
options- the TCP server socket options- Returns:
- this builder
- Throws:
IllegalArgumentException- ifoptionsisnull
-
withClientSocketOptions
public TcpServerParameters.Builder withClientSocketOptions(TcpClientSocketOptions options)
Sets the socket options used by TCP clients created by the server.- Parameters:
options- the TCP client socket options- Returns:
- this builder
- Throws:
IllegalArgumentException- ifoptionsisnull
-
build
public TcpServerParameters build()
Builds the parameters using the configuration specified by this builder.- Specified by:
buildin classServerParameters.Builder<TcpServerParameters.Builder>- Returns:
- the configured parameters
-
-