public abstract static class 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 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 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 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.
|
EConfigure.ConnectionType |
connectionType()
Returns the underlying channel type.
|
long |
heartbeatDelay()
Returns the configured heartbeat delay.
|
long |
heartbeatReplyDelay()
Returns the configured heartbeat reply delay.
|
int |
inputBufferSize()
Returns the configured input buffer size.
|
int |
messageQueueSize()
Returns the configured message queue size.
|
String |
name()
Returns the configuration name.
|
int |
outputBufferSize()
Returns the configured output buffer size.
|
protected void |
setByteOrder(ByteOrder byteOrder)
Sets the byte order used by accepted TCP connections.
|
protected void |
setConnectionType(EConfigure.ConnectionType connType)
Sets the channel type to the given value.
|
protected void |
setHeartbeatDelay(long delay)
Sets the heartbeat delay used for accepted TCP
connections.
|
protected void |
setHeartbeatReplyDelay(long delay)
Sets the heartbeat reply delay used for accepted TCP
connections.
|
protected void |
setInputBufferSize(int size)
Sets the input buffer size for all accepted TCP
connections.
|
protected void |
setMessageQueueSize(int size)
Sets the maximum queue size for accepted TCP
connections.
|
protected void |
setName(String name)
Sets the service name.
|
protected void |
setOutputBufferSize(int size)
Sets the output buffer size for all accept TCP
connections.
|
protected void |
setSSLContext(SSLContext context)
Sets the SSL context instance.
|
SSLContext |
sslContext()
Returns the configured SSL context.
|
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 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.protected final void setName(String name)
name - service name.NullPointerException - if name is null.IllegalArgumentException - if name is empty.protected final void setConnectionType(EConfigure.ConnectionType connType)
connType - underlying channel is of this type.protected final void setInputBufferSize(int size)
size is zero, then the default
input buffer size is used.size - accepted connection input buffer size.IllegalArgumentException - if size < zero.protected final void setOutputBufferSize(int size)
size is zero, then the default
output buffer size is used.size - accepted connection output buffer size.IllegalArgumentException - if size < zero.protected final void setByteOrder(ByteOrder byteOrder)
byteOrder - accepted connections serialize and
de-serialize messages using this byte order.NullPointerException - if byteOrder is nuill.protected final void setMessageQueueSize(int size)
size - message queue maximum size.IllegalArgumentException - if size < zero.protected final void setHeartbeatDelay(long delay)
delay milliseconds, then a heartbeat is sent.
If delay is zero, then heartbeating is turned
off.delay - millisecond heartbeat rate.IllegalArgumentException - if delay < zero.protected final void setHeartbeatReplyDelay(long delay)
delay milliseconds, the TCP
connection is closed. This value is ignored if the
heartbeat delay is zero.delay - millisecond heartbeat reply delay.IllegalArgumentException - if delay < zero.protected final void setSSLContext(SSLContext context)
EConfigure.ConnectionType.SECURE_TCP. If an SSL
context is provided for non-secure connection types,
then validation will fail.context - SSL context.NullPointerException - if context is null.protected void validate()
NullPointerException - if service name or connection type is not set or if
SSL context not provided for a secure connection.IllegalArgumentException - if SSL context provided for a non-secure connection.Copyright © 2019. All rights reserved.