Package org.omegazero.net.client
Class NetClientManagerBuilder
java.lang.Object
org.omegazero.net.common.NetworkApplicationBuilder
org.omegazero.net.client.NetClientManagerBuilder
- Direct Known Subclasses:
NioClientManagerBuilder
A
NetworkApplicationBuilder
for creating NetClientManager
s.- Since:
- 2.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class org.omegazero.net.common.NetworkApplicationBuilder
NetworkApplicationBuilder.TransportType
-
Field Summary
Fields inherited from class org.omegazero.net.common.NetworkApplicationBuilder
encrypted, sslContext, transportType, workerCreator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract NetClientManager
build()
Creates theNetworkApplication
from the previously set parameters.encrypted
(boolean encrypted) Sets whether to use encryption.Sets an implementation specific configuration parameter.sslContext
(SSLContext sslContext) Sets theSSLContext
to use for encryption.transportType
(NetworkApplicationBuilder.TransportType transportType) Sets theNetworkApplicationBuilder.TransportType
to use in this instance.workerCreator
(Function<SocketConnection, Consumer<Runnable>> workerCreator) Sets a worker creator which creates a worker instance for each connection created.Methods inherited from class org.omegazero.net.common.NetworkApplicationBuilder
addImplementationAlias, newClientManager, newServer, prepareBuild
-
Constructor Details
-
NetClientManagerBuilder
public NetClientManagerBuilder()
-
-
Method Details
-
build
Description copied from class:NetworkApplicationBuilder
Creates theNetworkApplication
from the previously set parameters.- Specified by:
build
in classNetworkApplicationBuilder
- Returns:
- The
NetworkApplication
-
transportType
Description copied from class:NetworkApplicationBuilder
Sets theNetworkApplicationBuilder.TransportType
to use in this instance.The default is
NetworkApplicationBuilder.TransportType.STREAM
.- Overrides:
transportType
in classNetworkApplicationBuilder
- Parameters:
transportType
- TheTransportType
- Returns:
- This builder
-
encrypted
Description copied from class:NetworkApplicationBuilder
Sets whether to use encryption. Specific implementation or types may require additional parameters to enable encryption.The default is
false
.- Overrides:
encrypted
in classNetworkApplicationBuilder
- Parameters:
encrypted
- Whether encryption is enabled- Returns:
- This builder
-
workerCreator
public NetClientManagerBuilder workerCreator(Function<SocketConnection, Consumer<Runnable>> workerCreator) Description copied from class:NetworkApplicationBuilder
Sets a worker creator which creates a worker instance for each connection created.The default is
null
(no workers).- Overrides:
workerCreator
in classNetworkApplicationBuilder
- Parameters:
workerCreator
- The function- Returns:
- This builder
-
sslContext
Description copied from class:NetworkApplicationBuilder
Sets theSSLContext
to use for encryption.This method implicitly enables encryption if the given parameter is not
null
, and disables it otherwise.The default is
null
. Setting this parameter may be required by the implementation if encryption is enabled.- Overrides:
sslContext
in classNetworkApplicationBuilder
- Parameters:
sslContext
- TheSSLContext
- Returns:
- This builder
-
set
Description copied from class:NetworkApplicationBuilder
Sets an implementation specific configuration parameter.- Overrides:
set
in classNetworkApplicationBuilder
- Parameters:
option
- The name of the parametervalue
- The value
-