Class NetworkServiceFactory
- java.lang.Object
-
- io.hekate.network.NetworkServiceFactory
-
- All Implemented Interfaces:
ServiceFactory<NetworkService>
public class NetworkServiceFactory extends Object implements ServiceFactory<NetworkService>
Factory forNetworkService
.This class represents a configurable factory for
NetworkService
. Instances of this class can beregistered
within theHekateBootstrap
in order to customize options of theNetworkService
.For more details about the
NetworkService
and its capabilities please see the documentation ofNetworkService
interface.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_ACCEPT_RETRY_INTERVAL
Default value (=1000) forsetAcceptRetryInterval(long)
.static int
DEFAULT_CONNECT_TIMEOUT
Default value (=3000) forsetConnectTimeout(int)
.static int
DEFAULT_HB_INTERVAL
Default value (=1000) forsetHeartbeatInterval(int)
.static int
DEFAULT_HB_LOSS_THRESHOLD
Default value (=3) forsetHeartbeatLossThreshold(int)
.static int
DEFAULT_PORT
Default value (=10012) forsetPort(int)
.static int
DEFAULT_PORT_RANGE
Default value (=100) forsetPortRange(int)
.static boolean
DEFAULT_TCP_NO_DELAY
Default value (=true) forsetTcpNoDelay(boolean)
.
-
Constructor Summary
Constructors Constructor Description NetworkServiceFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetworkService
createService()
Constructs a new service instance based on the configuration options of this factory.long
getAcceptRetryInterval()
Returns the number of milliseconds to wait before trying to re-create a TCP socket acceptor in case of a failure (seesetAcceptRetryInterval(long)
).List<NetworkConfigProvider>
getConfigProviders()
Returns the list of connector configuration providers (seesetConfigProviders(List)
).List<NetworkConnectorConfig<?>>
getConnectors()
Returns the list of connector configurations (seesetConnectors(List)
).int
getConnectTimeout()
Returns the TCP connect timeout in milliseconds (seesetConnectTimeout(int)
).int
getHeartbeatInterval()
Returns the heartbeat sending interval in milliseconds (seesetHeartbeatInterval(int)
).int
getHeartbeatLossThreshold()
Returns the maximum number of lost heartbeats (seesetHeartbeatLossThreshold(int)
).String
getHost()
Supplementary getter forsetHost(String)
.AddressSelector
getHostSelector()
Returns host address selector of the local node (seesetHostSelector(AddressSelector)
).int
getNioThreads()
Returns the number of threads to be used for NIO event processing (seesetNioThreads(int)
).int
getPort()
Returns communications port of the local node (seesetPort(int)
).int
getPortRange()
Returns the port range (seesetPortRange(int)
).NetworkSslConfig
getSsl()
Returns the SSL configuration (seesetSsl(NetworkSslConfig)
).Integer
getTcpBacklog()
Returns the maximum number of pending connections that can be queued on the server socket channel (seesetTcpBacklog(Integer)
).Integer
getTcpReceiveBufferSize()
Returns the size of the socket receive buffer in bytes (seesetTcpReceiveBufferSize(Integer)
).Boolean
getTcpReuseAddress()
Sets flag indicating that socket addresses should be re-used (seesetTcpReuseAddress(Boolean)
).Integer
getTcpSendBufferSize()
Returns the size of the socket send buffer in bytes (seesetTcpSendBufferSize(Integer)
).NetworkTransportType
getTransport()
Returns the transport type (seesetTransport(NetworkTransportType)
).boolean
isTcpNoDelay()
Returnstrue
ifTCP_NODELAY
option must be set on TCP socket connections (seesetTcpNoDelay(boolean)
).void
setAcceptRetryInterval(long acceptRetryInterval)
Sets the number of milliseconds to wait before trying to re-create a TCP socket acceptor in case of its failure.void
setConfigProviders(List<NetworkConfigProvider> configProviders)
Sets the list of connector configuration providers.void
setConnectors(List<NetworkConnectorConfig<?>> connectors)
Sets the list of connector configurations that should be registered within theNetworkService
.void
setConnectTimeout(int connectTimeout)
Sets the timeout in milliseconds for establishing a TCP socket connection to a remote node.void
setHeartbeatInterval(int heartbeatInterval)
Sets the heartbeat sending interval in milliseconds for keeping a TCP socket connection alive.void
setHeartbeatLossThreshold(int heartbeatLossThreshold)
Sets the maximum number of lost heartbeats before considering a TCP connection to be failed.void
setHost(String pattern)
Sets the host address selection pattern (seeAddressPattern
).void
setHostSelector(AddressSelector hostSelector)
Sets the host address selector that will be used to select an address of the local cluster node.void
setNioThreads(int nioThreads)
Sets the number of threads to be used for NIO event processing.void
setPort(int port)
Sets port number that will be used by the local node to accept network connections.void
setPortRange(int portRange)
Sets maximum value that can be used forport
auto-incrementing.void
setSsl(NetworkSslConfig ssl)
Sets the SSL configuration.void
setTcpBacklog(Integer tcpBacklog)
Sets the maximum number of pending connections that can be queued on the server socket channel (seeServerSocketChannel.bind(SocketAddress, int)
for more details).void
setTcpNoDelay(boolean tcpNoDelay)
Sets the flag indicating thatTCP_NODELAY
option must be set on TCP socket connections.void
setTcpReceiveBufferSize(Integer tcpReceiveBufferSize)
Sets the size of the socket receive buffer in bytes (seeStandardSocketOptions.SO_RCVBUF
for more details).void
setTcpReuseAddress(Boolean tcpReuseAddress)
Sets flag indicating that socket addresses should be re-used (seeStandardSocketOptions.SO_REUSEADDR
for more details).void
setTcpSendBufferSize(Integer tcpSendBufferSize)
Sets the size of the socket send buffer in bytes (seeStandardSocketOptions.SO_SNDBUF
for more details).void
setTransport(NetworkTransportType transport)
Sets the transport type that controls which implementation of NIO API should be used.String
toString()
NetworkServiceFactory
withAcceptRetryInterval(long acceptRetryInterval)
Fluent-style version ofsetAcceptRetryInterval(long)
.NetworkServiceFactory
withConfigProvider(NetworkConfigProvider configProvider)
Fluent-style version ofsetConfigProviders(List)
.NetworkServiceFactory
withConnector(NetworkConnectorConfig<?> connector)
Fluent-style version ofsetConnectors(List)
.NetworkServiceFactory
withConnectTimeout(int connectTimeout)
Fluent-style version ofsetConnectTimeout(int)
.NetworkServiceFactory
withHeartbeatInterval(int heartbeatInterval)
Fluent-style version ofsetHeartbeatInterval(int)
.NetworkServiceFactory
withHeartbeatLossThreshold(int heartbeatLossThreshold)
Fluent-style version ofsetHeartbeatLossThreshold(int)
.NetworkServiceFactory
withHost(String pattern)
Fluent-style version ofsetHost(String)
.NetworkServiceFactory
withHostSelector(AddressSelector host)
Fluent-style version ofsetHostSelector(AddressSelector)
.NetworkServiceFactory
withNioThreads(int nioThreads)
Fluent-style version ofsetNioThreads(int)
.NetworkServiceFactory
withPort(int port)
Fluent-style version ofsetPort(int)
.NetworkServiceFactory
withPortRange(int portRange)
Fluent-style version ofsetPortRange(int)
.NetworkServiceFactory
withSsl(NetworkSslConfig ssl)
Fluent-style version ofsetSsl(NetworkSslConfig)
.NetworkServiceFactory
withTcpBacklog(Integer soBacklog)
Fluent-style version ofsetTcpBacklog(Integer)
.NetworkServiceFactory
withTcpNoDelay(Boolean tcpNoDelay)
Fluent-style version ofsetTcpNoDelay(boolean)
.NetworkServiceFactory
withTcpReceiveBufferSize(Integer tcpReceiveBufferSize)
Fluent-style version ofsetTcpReceiveBufferSize(Integer)
.NetworkServiceFactory
withTcpReuseAddress(Boolean soReuseAddress)
Fluent-style version ofsetTcpReuseAddress(Boolean)
.NetworkServiceFactory
withTcpSendBufferSize(Integer soSendBufferSize)
Fluent-style version ofsetTcpSendBufferSize(Integer)
.NetworkServiceFactory
withTransport(NetworkTransportType transport)
Fluent-style version ofsetTransport(NetworkTransportType)
.
-
-
-
Field Detail
-
DEFAULT_PORT
public static final int DEFAULT_PORT
Default value (=10012) forsetPort(int)
.- See Also:
- Constant Field Values
-
DEFAULT_PORT_RANGE
public static final int DEFAULT_PORT_RANGE
Default value (=100) forsetPortRange(int)
.- See Also:
- Constant Field Values
-
DEFAULT_HB_INTERVAL
public static final int DEFAULT_HB_INTERVAL
Default value (=1000) forsetHeartbeatInterval(int)
.- See Also:
- Constant Field Values
-
DEFAULT_HB_LOSS_THRESHOLD
public static final int DEFAULT_HB_LOSS_THRESHOLD
Default value (=3) forsetHeartbeatLossThreshold(int)
.- See Also:
- Constant Field Values
-
DEFAULT_ACCEPT_RETRY_INTERVAL
public static final int DEFAULT_ACCEPT_RETRY_INTERVAL
Default value (=1000) forsetAcceptRetryInterval(long)
.- See Also:
- Constant Field Values
-
DEFAULT_CONNECT_TIMEOUT
public static final int DEFAULT_CONNECT_TIMEOUT
Default value (=3000) forsetConnectTimeout(int)
.- See Also:
- Constant Field Values
-
DEFAULT_TCP_NO_DELAY
public static final boolean DEFAULT_TCP_NO_DELAY
Default value (=true) forsetTcpNoDelay(boolean)
.- See Also:
- Constant Field Values
-
-
Method Detail
-
getHostSelector
public AddressSelector getHostSelector()
Returns host address selector of the local node (seesetHostSelector(AddressSelector)
).- Returns:
- Host address.
-
setHostSelector
public void setHostSelector(AddressSelector hostSelector)
Sets the host address selector that will be used to select an address of the local cluster node.- Parameters:
hostSelector
- Address selector.- See Also:
setHost(String)
-
withHostSelector
public NetworkServiceFactory withHostSelector(AddressSelector host)
Fluent-style version ofsetHostSelector(AddressSelector)
.- Parameters:
host
- IP address or host name.- Returns:
- This instance.
-
getHost
public String getHost()
Supplementary getter forsetHost(String)
. Returns the host selection pattern if this factory is configured withAddressPattern
; returnsnull
otherwise.- Returns:
- host selection pattern if this factory is configured with
AddressPattern
; returnsnull
otherwise.
-
setHost
public void setHost(String pattern)
Sets the host address selection pattern (seeAddressPattern
).The following patterns can be specified:
- any - any non-loopback address
- any-ip4 - any IPv6 non-loopback address
- ip~regex - any IP address that matches the specified regular expression
- ip4~regex - any IPv4 address that matches the specified regular expression
- ip6~regex - any IPv6 address that matches the specified regular expression
- !ip~regex - any IP address that does NOT match the specified regular expression
- !ip4~regex - any IPv4 address that does NOT match the specified regular expression
- !ip6~regex - any IPv6 address that does NOT match the specified regular expression
- net~regex - any IP address of a network interface who's
name
matches the specified regular expression - net4~regex - IPv4 address of a network interface who's
name
matches the specified regular expression - net6~regex - IPv6 address of a network interface who's
name
matches the specified regular expression - !net~regex - any IP address of a network interface who's
name
does NOT match the specified regular expression - !net4~regex - IPv4 address of a network interface who's
name
does NOT match the specified regular expression - !net6~regex - IPv6 address of a network interface who's
name
does NOT match the specified regular expression - ...all other values will be treated as a directly specified address (see
InetAddress.getByName(String)
)
If multiple addresses match the specified pattern then the first one will be selected (order is not guaranteed).
- Parameters:
pattern
- Address selection pattern (seeAddressPattern
).- See Also:
setHostSelector(AddressSelector)
,AddressPattern
-
withHost
public NetworkServiceFactory withHost(String pattern)
Fluent-style version ofsetHost(String)
.- Parameters:
pattern
- Address selection pattern (seeAddressPattern
).- Returns:
- This instance.
- See Also:
AddressPattern
-
getPort
public int getPort()
Returns communications port of the local node (seesetPort(int)
).- Returns:
- The port number.
-
setPort
public void setPort(int port)
Sets port number that will be used by the local node to accept network connections.If specified port number is
0
then ephemeral port will be assigned by the underlying OS.Note that it is possible to specify port ranges via
setPortRange(int)
method.Default value of this parameter is 10012
- Parameters:
port
- The port number.- See Also:
setPortRange(int)
-
withPort
public NetworkServiceFactory withPort(int port)
Fluent-style version ofsetPort(int)
.- Parameters:
port
- The port number.- Returns:
- This instance.
-
getPortRange
public int getPortRange()
Returns the port range (seesetPortRange(int)
).- Returns:
- Port range.
-
setPortRange
public void setPortRange(int portRange)
Sets maximum value that can be used forport
auto-incrementing.Local node will try to bind on the first available port starting with
getPort()
up togetPort()
+getPortRange()
. If value of this property is less than or equals to zero then port auto-incrementing will be disabled.Default value of this parameter is 100
- Parameters:
portRange
- Port range.
-
withPortRange
public NetworkServiceFactory withPortRange(int portRange)
Fluent-style version ofsetPortRange(int)
.- Parameters:
portRange
- Port range.- Returns:
- This instance.
-
getConnectTimeout
public int getConnectTimeout()
Returns the TCP connect timeout in milliseconds (seesetConnectTimeout(int)
).- Returns:
- Timeout in milliseconds.
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout)
Sets the timeout in milliseconds for establishing a TCP socket connection to a remote node.Negative value or zero means that no timeout should happen.
The default value of this parameter is 3000.
- Parameters:
connectTimeout
- Timeout in milliseconds.
-
withConnectTimeout
public NetworkServiceFactory withConnectTimeout(int connectTimeout)
Fluent-style version ofsetConnectTimeout(int)
.- Parameters:
connectTimeout
- Timeout in milliseconds.- Returns:
- This instance.
-
getAcceptRetryInterval
public long getAcceptRetryInterval()
Returns the number of milliseconds to wait before trying to re-create a TCP socket acceptor in case of a failure (seesetAcceptRetryInterval(long)
).- Returns:
- Number of milliseconds.
-
setAcceptRetryInterval
public void setAcceptRetryInterval(long acceptRetryInterval)
Sets the number of milliseconds to wait before trying to re-create a TCP socket acceptor in case of its failure.Negative value or zero means that retrying should not take place and
Hekate
instance must stop with an error.The default value of this parameter is 1000.
- Parameters:
acceptRetryInterval
- Number of milliseconds to wait.
-
withAcceptRetryInterval
public NetworkServiceFactory withAcceptRetryInterval(long acceptRetryInterval)
Fluent-style version ofsetAcceptRetryInterval(long)
.- Parameters:
acceptRetryInterval
- Number of milliseconds to wait.- Returns:
- This instance.
-
getHeartbeatInterval
public int getHeartbeatInterval()
Returns the heartbeat sending interval in milliseconds (seesetHeartbeatInterval(int)
).- Returns:
- Heartbeat interval in milliseconds.
-
setHeartbeatInterval
public void setHeartbeatInterval(int heartbeatInterval)
Sets the heartbeat sending interval in milliseconds for keeping a TCP socket connection alive.This setting is used by a TCP connection peer to notify other peer that it is alive. This is archived by sending a small dummy message if there was no other activity (i.e. no other messages sent) for the specified time interval. Also please see
setHeartbeatLossThreshold(int)
for details of how this parameter is used for connection failure detection.Value of this parameter must be above zero.
Default value of this parameter is 1000.
- Parameters:
heartbeatInterval
- Heartbeat interval in milliseconds.- See Also:
setHeartbeatLossThreshold(int)
-
withHeartbeatInterval
public NetworkServiceFactory withHeartbeatInterval(int heartbeatInterval)
Fluent-style version ofsetHeartbeatInterval(int)
.- Parameters:
heartbeatInterval
- Heartbeat interval in milliseconds.- Returns:
- This instance.
-
getHeartbeatLossThreshold
public int getHeartbeatLossThreshold()
Returns the maximum number of lost heartbeats (seesetHeartbeatLossThreshold(int)
).- Returns:
- Maximum number of lost heartbeats.
-
setHeartbeatLossThreshold
public void setHeartbeatLossThreshold(int heartbeatLossThreshold)
Sets the maximum number of lost heartbeats before considering a TCP connection to be failed.This setting works in conjunction with
setHeartbeatInterval(int)
to calculate the total amount of time for a TCP connection to stay inactive (i.e. do not send any heartbeats or application data). When this timeout elapses then connection is considered to be failed and will be closed with aNetworkTimeoutException
.For example: if heartbeat interval is 500 and loss threshold is 3 then a TCP connection will be closed with and error after 1500 milliseconds of inactivity.
Value of this parameter must be above zero.
Default value of this parameter is 3.
- Parameters:
heartbeatLossThreshold
- Maximum number of lost heartbeats.
-
withHeartbeatLossThreshold
public NetworkServiceFactory withHeartbeatLossThreshold(int heartbeatLossThreshold)
Fluent-style version ofsetHeartbeatLossThreshold(int)
.- Parameters:
heartbeatLossThreshold
- Maximum number of lost heartbeats.- Returns:
- This instance.
-
getNioThreads
public int getNioThreads()
Returns the number of threads to be used for NIO event processing (seesetNioThreads(int)
).- Returns:
- Number of threads for NIO event processing.
-
setNioThreads
public void setNioThreads(int nioThreads)
Sets the number of threads to be used for NIO event processing.Value of this parameter must be above zero.
Default value of this parameter is the number of CPUs available to the JVM (see
Runtime.availableProcessors()
).- Parameters:
nioThreads
- Number of threads for NIO event processing.
-
withNioThreads
public NetworkServiceFactory withNioThreads(int nioThreads)
Fluent-style version ofsetNioThreads(int)
.- Parameters:
nioThreads
- Number of threads for NIO event processing.- Returns:
- This instance.
-
getTransport
public NetworkTransportType getTransport()
Returns the transport type (seesetTransport(NetworkTransportType)
).- Returns:
- Transport type.
-
setTransport
public void setTransport(NetworkTransportType transport)
Sets the transport type that controls which implementation of NIO API should be used.Possible values are:
NetworkTransportType.NIO
- Use the default implementation that is provided by the JVM.NetworkTransportType.EPOLL
- Use the optimized Epoll-based implementation (for Linux environments only). Note that this implementation requires Netty's 'netty-transport-native-epoll' module to be on the classpath.NetworkTransportType.AUTO
- Try to autodetect which implementation to use depending on the runtime environment.
This parameter is mandatory and can't be
null
. Default value of this parameter isNetworkTransportType.AUTO
- Parameters:
transport
- Transport type.
-
withTransport
public NetworkServiceFactory withTransport(NetworkTransportType transport)
Fluent-style version ofsetTransport(NetworkTransportType)
.- Parameters:
transport
- Transport type.- Returns:
- This instance.
-
isTcpNoDelay
public boolean isTcpNoDelay()
Returnstrue
ifTCP_NODELAY
option must be set on TCP socket connections (seesetTcpNoDelay(boolean)
).- Returns:
true
ifTCP_NODELAY
option must be set.
-
setTcpNoDelay
public void setTcpNoDelay(boolean tcpNoDelay)
Sets the flag indicating thatTCP_NODELAY
option must be set on TCP socket connections.Please see Nagle's algorithm for more info.
Default value of this parameter is true.
- Parameters:
tcpNoDelay
-true
ifTCP_NODELAY
option must be set.
-
withTcpNoDelay
public NetworkServiceFactory withTcpNoDelay(Boolean tcpNoDelay)
Fluent-style version ofsetTcpNoDelay(boolean)
.- Parameters:
tcpNoDelay
-true
ifTCP_NODELAY
option must be set.- Returns:
- This instance.
-
getTcpReceiveBufferSize
public Integer getTcpReceiveBufferSize()
Returns the size of the socket receive buffer in bytes (seesetTcpReceiveBufferSize(Integer)
).- Returns:
- Buffer size in bytes or
null
if it wasn't set.
-
setTcpReceiveBufferSize
public void setTcpReceiveBufferSize(Integer tcpReceiveBufferSize)
Sets the size of the socket receive buffer in bytes (seeStandardSocketOptions.SO_RCVBUF
for more details).Default value of this parameter is
null
.- Parameters:
tcpReceiveBufferSize
- Buffer size in bytes.
-
withTcpReceiveBufferSize
public NetworkServiceFactory withTcpReceiveBufferSize(Integer tcpReceiveBufferSize)
Fluent-style version ofsetTcpReceiveBufferSize(Integer)
.- Parameters:
tcpReceiveBufferSize
- Buffer size in bytes.- Returns:
- This instance.
-
getTcpSendBufferSize
public Integer getTcpSendBufferSize()
Returns the size of the socket send buffer in bytes (seesetTcpSendBufferSize(Integer)
).- Returns:
- Buffer size in bytes or
null
if it wasn't set.
-
setTcpSendBufferSize
public void setTcpSendBufferSize(Integer tcpSendBufferSize)
Sets the size of the socket send buffer in bytes (seeStandardSocketOptions.SO_SNDBUF
for more details).Default value of this parameter is
null
.- Parameters:
tcpSendBufferSize
- Buffer size in bytes.
-
withTcpSendBufferSize
public NetworkServiceFactory withTcpSendBufferSize(Integer soSendBufferSize)
Fluent-style version ofsetTcpSendBufferSize(Integer)
.- Parameters:
soSendBufferSize
- Buffer size in bytes.- Returns:
- This instance.
-
getTcpReuseAddress
public Boolean getTcpReuseAddress()
Sets flag indicating that socket addresses should be re-used (seesetTcpReuseAddress(Boolean)
).- Returns:
- Flag value or
null
if it wasn't set.
-
setTcpReuseAddress
public void setTcpReuseAddress(Boolean tcpReuseAddress)
Sets flag indicating that socket addresses should be re-used (seeStandardSocketOptions.SO_REUSEADDR
for more details).Default value of this parameter is
null
.- Parameters:
tcpReuseAddress
- Flag indicating that socket addresses should be re-used.
-
withTcpReuseAddress
public NetworkServiceFactory withTcpReuseAddress(Boolean soReuseAddress)
Fluent-style version ofsetTcpReuseAddress(Boolean)
.- Parameters:
soReuseAddress
- Flag indicating that socket addresses should be re-used.- Returns:
- This instance.
-
getTcpBacklog
public Integer getTcpBacklog()
Returns the maximum number of pending connections that can be queued on the server socket channel (seesetTcpBacklog(Integer)
).- Returns:
- The maximum number of pending connections or
null
if it wasn't set.
-
setTcpBacklog
public void setTcpBacklog(Integer tcpBacklog)
Sets the maximum number of pending connections that can be queued on the server socket channel (seeServerSocketChannel.bind(SocketAddress, int)
for more details).Default value of this parameter is
null
.- Parameters:
tcpBacklog
- The maximum number of pending connections.
-
withTcpBacklog
public NetworkServiceFactory withTcpBacklog(Integer soBacklog)
Fluent-style version ofsetTcpBacklog(Integer)
.- Parameters:
soBacklog
- The maximum number of pending connections.- Returns:
- This instance.
-
getConnectors
public List<NetworkConnectorConfig<?>> getConnectors()
Returns the list of connector configurations (seesetConnectors(List)
).- Returns:
- List of connector configurations.
-
setConnectors
public void setConnectors(List<NetworkConnectorConfig<?>> connectors)
Sets the list of connector configurations that should be registered within theNetworkService
.- Parameters:
connectors
- Connector configurations.- See Also:
NetworkService.connector(String)
-
withConnector
public NetworkServiceFactory withConnector(NetworkConnectorConfig<?> connector)
Fluent-style version ofsetConnectors(List)
.- Parameters:
connector
- Connector configuration.- Returns:
- This instance.
-
getConfigProviders
public List<NetworkConfigProvider> getConfigProviders()
Returns the list of connector configuration providers (seesetConfigProviders(List)
).- Returns:
- Connector configuration providers.
-
setConfigProviders
public void setConfigProviders(List<NetworkConfigProvider> configProviders)
Sets the list of connector configuration providers.- Parameters:
configProviders
- Connector configuration providers.- See Also:
NetworkConfigProvider
-
withConfigProvider
public NetworkServiceFactory withConfigProvider(NetworkConfigProvider configProvider)
Fluent-style version ofsetConfigProviders(List)
.- Parameters:
configProvider
- Connector configuration provider.- Returns:
- This instance.
-
getSsl
public NetworkSslConfig getSsl()
Returns the SSL configuration (seesetSsl(NetworkSslConfig)
).- Returns:
- SSL configuration.
-
setSsl
public void setSsl(NetworkSslConfig ssl)
Sets the SSL configuration.If the specified configuration is not
null
then SSL encryption will be applied to all network communications. Note that SSL must be enabled/disabled on all nodes in the cluster. Mixed mode where some nodes have SSL enabled and some nodes have SSL disabled is not supported.- Parameters:
ssl
- SSL configuration.
-
withSsl
public NetworkServiceFactory withSsl(NetworkSslConfig ssl)
Fluent-style version ofsetSsl(NetworkSslConfig)
.- Parameters:
ssl
- SSL configuration.- Returns:
- This instance.
-
createService
public NetworkService createService()
Description copied from interface:ServiceFactory
Constructs a new service instance based on the configuration options of this factory.- Specified by:
createService
in interfaceServiceFactory<NetworkService>
- Returns:
- New service instance.
-
-