T - builder subclass.public abstract static class EConfigure.AbstractBuilder<T extends EConfigure.AbstractBuilder> extends Object
EConfigure.ServerBuilder and
EConfigure.ConnectionBuilder, containing the properties
common to both.| Modifier and Type | Field and Description |
|---|---|
protected ByteOrder |
mByteOrder
Code and decode messages in this byte order.
|
protected boolean |
mCanPause
Set to
true if remote connections may be
paused. |
protected long |
mHbDelay
Send a heartbeat message after this many milliseconds
of inbound message inactivity.
|
protected long |
mHbReplyDelay
The number of milliseconds the far-end has to respond
to a heartbeat.
|
protected int |
mInputBufferSize
Maximum input buffer size.
|
protected boolean |
mLoaderFlag
Set to
true if this builder is used when
loading a configuration. |
protected int |
mMsgQueueSize
Maximum eBus message outbound queue size for remote
connections.
|
protected String |
mName
Unique service or connection name.
|
protected int |
mOutputBufferSize
Maximum output buffer size.
|
protected EConfigure.PauseConfig |
mPauseConfig
Contains the pause parameters.
|
protected SSLContext |
mSSLContext
The SSL/TLS context used for a secure TCP connection.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractBuilder()
Creates a new abstract configuration builder.
|
| Modifier and Type | Method and Description |
|---|---|
ByteOrder |
byteOrder()
Returns the configured byte order.
|
T |
byteOrder(ByteOrder byteOrder)
Sets the byte order used by the connection.
|
boolean |
canPause()
Returns
true if accepted connections may be
paused; false means pause requests will be
rejected. |
T |
canPause(boolean flag)
Sets a flag specifying whether accepted connections
may be paused (
true) or not. |
protected T |
configuration(EConfigure.AbstractConfig config)
Copies the values found in
config to this
configuration. |
EConfigure.ConnectionType |
connectionType()
Returns the underlying channel type.
|
T |
connectionType(EConfigure.ConnectionType connType)
Sets the underlying channel type.
|
long |
heartbeatDelay()
Returns the configured heartbeat delay.
|
T |
heartbeatDelay(long delay)
Sets the heartbeat delay used for the connection.
|
long |
heartbeatReplyDelay()
Returns the configured heartbeat reply delay.
|
T |
heartbeatReplyDelay(long delay)
Sets the heartbeat reply delay used for the
connection.
|
int |
inputBufferSize()
Returns the configured input buffer size.
|
T |
inputBufferSize(int size)
Sets the input buffer size for the connection.
|
protected T |
loaderFlag(boolean flag)
Sets the loader flag to the given value.
|
int |
messageQueueSize()
Returns the configured message queue size.
|
T |
messageQueueSize(int size)
Sets the maximum queue size for the connection.
|
String |
name()
Returns the configuration name.
|
T |
name(String name)
Sets the service/connection name.
|
int |
outputBufferSize()
Returns the configured output buffer size.
|
T |
outputBufferSize(int size)
Sets the output buffer size for the connection.
|
EConfigure.PauseConfig |
pauseConfig()
Returns the pause configuration.
|
T |
pauseConfig(EConfigure.PauseConfig pc)
Set the pause configuration for the connection.
|
SSLContext |
sslContext()
Returns the configured SSL context.
|
T |
sslContext(SSLContext context)
Sets the SSL/TLS context used by a secure location.
|
protected void |
validate()
Validates builder arguments are correctly set,
throwing the appropriate exception if validation
fails.
|
protected String mName
protected int mInputBufferSize
SSLSession.getApplicationBufferSize()
when using a secure TCP connection.protected int mOutputBufferSize
SSLSession.getPacketBufferSize()
when using a secure TCP connection.protected ByteOrder mByteOrder
protected int mMsgQueueSize
protected long mHbDelay
protected long mHbReplyDelay
protected SSLContext mSSLContext
protected boolean mCanPause
true if remote connections may be
paused.protected EConfigure.PauseConfig mPauseConfig
protected boolean mLoaderFlag
true if this builder is used when
loading a configuration. This flag is used to detect
when a secure TCP session is defined in a
configuration as opposed to built by an application.
If so, then the session definition is not required
to define the SSL context.protected AbstractBuilder()
public final String name()
null
if name is not set.public final EConfigure.ConnectionType connectionType()
public final int inputBufferSize()
public final int outputBufferSize()
public final ByteOrder byteOrder()
public final int messageQueueSize()
public final long heartbeatDelay()
public final long heartbeatReplyDelay()
public final SSLContext sslContext()
null if connectionType() is
not EConfigure.ConnectionType.SECURE_TCP.public boolean canPause()
true if accepted connections may be
paused; false means pause requests will be
rejected.true if pausing is allowed.public EConfigure.PauseConfig pauseConfig()
null if pausing is not
allowed.public final T name(String name)
name - service/connection name.this service/connection builder.com.typesafe.config.ConfigException - if name is null or empty.public final T connectionType(EConfigure.ConnectionType connType)
connType - channel type.this service/connection builder.com.typesafe.config.ConfigException - if connType is null.public final T inputBufferSize(int size)
size is zero, then the default input buffer
size is used.size - connection input buffer size.this service/connection builder.com.typesafe.config.ConfigException - if size < zero.public final T outputBufferSize(int size)
size is zero, then the default output buffer
size is used.size - accepted connection output buffer size.this service/connection builder.com.typesafe.config.ConfigException - if size < zero.public final T byteOrder(ByteOrder byteOrder)
byteOrder - connection serialize and
de-serialize messages using this byte order.this service/connection builder.com.typesafe.config.ConfigException - if byteOrder is nuill.public final T messageQueueSize(int size)
size - message queue maximum size.this service/connection builder.com.typesafe.config.ConfigException - if size < zero.public final T heartbeatDelay(long delay)
delay
milliseconds, then a heartbeat is sent. If
delay is zero, then heartbeating is turned
off.delay - millisecond heartbeat rate.this service/connection builder.com.typesafe.config.ConfigException - if delay < zero.public final T heartbeatReplyDelay(long delay)
delay milliseconds, the
connection is closed. This value is ignored if the
heartbeat delay is zero.delay - millisecond heartbeat reply delay.this service/connection builder.com.typesafe.config.ConfigException - if delay < zero.public final T sslContext(SSLContext context)
EConfigure.ConnectionType.SECURE_TCP.context - secure TCP context.this server/connection builder.com.typesafe.config.ConfigException - if context is null.public final T canPause(boolean flag)
true) or not.flag - pause-able connection flag.this connection builder.public final T pauseConfig(EConfigure.PauseConfig pc)
canPause(boolean)
must be set to true before setting
the pause configuration.
pc - pause configurationthis server/connection builder.com.typesafe.config.ConfigException - if canPause() returns false
(meaning the connection cannot be pause) or if
pc is null.protected T configuration(EConfigure.AbstractConfig config)
config to this
configuration. This method is used to modify an
existing immutable configuration.config - copy this configuration's values.this server/connection builder.protected final T loaderFlag(boolean flag)
flag - loader flag value.this server/connection builder.protected void validate()
com.typesafe.config.ConfigException - if service name or connection type is not set, if
SSL context not provided for a secure connection, or
if SSL context provided for a non-secure connection.Copyright © 2019. All rights reserved.