public static final class EConfigure.PauseBuilder extends Object
EConfigure.PauseConfig instance based on the
parameters set via the builder API. Configuration settings
are based on the connection role. Pause duration and
maximum backlog size may be set for both connection
acceptor and initiator. The remaining settings (discard
policy, idle time, maximum connection time, and
resume-on-backlog-size) may only be set for initiators.
Properties depend on the connection role. For acceptor, only the pause duration (required) and maximum backlog size (optional) may be set. For initiator, all properties may be used where pause duration and maximum connect time are required and the remaining properties are optional.
EConfigure.PauseConfig - acceptor final EConfigure.PauseBuilder builder = new EConfigure.pauseBuilder(EConfigure.ConnectionRole.Acceptor);
final EConfigure.PauseConfig pauseConfig = builder.duration(Duration.ofMinutes(5L)
.maxBacklogSize(10)
.build();
EConfigure.PauseConfig - initiator final EConfigure.PauseBuilder builder = new EConfigure.pauseBuilder(EConfigure.ConnectionRole.Acceptor);
final EConfigure.PauseConfig pauseConfig = builder.duration(Duration.ofMinutes(5L)
.maxBacklogSize(20)
.discardPolicy(EConfigure.DiscardPolicy.OLDEST_FIRST)
.maxConnectionTime(Duration.ofSeconds(30L))
.resumeOnBacklogSize(5)
.build();| Modifier and Type | Method and Description |
|---|---|
EConfigure.PauseConfig |
build()
Returns the pause configuration created from the
configured parameters.
|
EConfigure.DiscardPolicy |
discardPolicy()
Returns the message discard policy used when the
maximum message backlog size is breached.
|
EConfigure.PauseBuilder |
discardPolicy(EConfigure.DiscardPolicy policy)
Sets the backlog discard policy and returns
this pause configuration builder. |
Duration |
duration()
Returns the maximum allowed pause duration.
|
EConfigure.PauseBuilder |
duration(Duration duration)
Sets the pause duration and returns
this
pause configuration builder. |
Duration |
idleTime()
Returns the amount of time wherein no messages are
sent or received on the connection before the
connection is paused.
|
EConfigure.PauseBuilder |
idleTime(Duration duration)
Sets the idle time duration and returns
this
pause configuration builder. |
int |
maxBacklogSize()
Returns the maximum allowed message backlog size.
|
EConfigure.PauseBuilder |
maxBacklogSize(int size)
Sets the maximum backlog size and returns
this
pause configuration builder. |
EConfigure.PauseBuilder |
maxConnectionTime(Duration duration)
Sets the maximum connection time duration and
returns
this pause configuration builder. |
Duration |
maxConnectTime()
Returns the maximum time a connection may remain up
before being paused.
|
int |
resumeOnBacklogSize()
Returns the transmit queue limit which triggers an
automatic client connection resumption.
|
EConfigure.PauseBuilder |
resumeOnBacklogSize(int size)
Sets the transmit queue limit which trigger automatic
client connection resumption.
|
EConfigure.ConnectionRole |
role()
Returns the connection role.
|
public EConfigure.ConnectionRole role()
public Duration duration()
public int maxBacklogSize()
public EConfigure.DiscardPolicy discardPolicy()
public Duration idleTime()
public Duration maxConnectTime()
public int resumeOnBacklogSize()
public EConfigure.PauseBuilder duration(Duration duration)
this
pause configuration builder. This value must be set
for both acceptor and initiator connections.duration - pause duration.this PauseBuilder.com.typesafe.config.ConfigException - if duration is null or is ≤ zero.public EConfigure.PauseBuilder maxBacklogSize(int size)
this
pause configuration builder. This value may be set
for both acceptor and initiator connections.size - maximum backlog size.this PauseBuilder.com.typesafe.config.ConfigException - if size is < zero.public EConfigure.PauseBuilder discardPolicy(EConfigure.DiscardPolicy policy)
this pause configuration builder. This value
may only be set for initiator connections.policy - backlog overflow discard policy.this PauseBuilder.com.typesafe.config.ConfigException - if this is a acceptor connection or policy is
null.public EConfigure.PauseBuilder idleTime(Duration duration)
this
pause configuration builder. This value may only be
set for initiator connections.duration - maximum idle time duration.this PauseBuilder.com.typesafe.config.ConfigException - if this is a acceptor connection or duration
is null or is ≤ zero.public EConfigure.PauseBuilder maxConnectionTime(Duration duration)
this pause configuration builder.
This value may only be set for initiator connections.duration - maximum connection time duration.this PauseBuilder.com.typesafe.config.ConfigException - if this is a acceptor connection or duration
is null or is ≤ zero.public EConfigure.PauseBuilder resumeOnBacklogSize(int size)
limit is zero
then this feature is disabled. Note: the transmit
queue size is based on the number of queued
application messages only.
This value may only be set for initiator connections.
size - transmit queue size trigger connection
resumption.this PauseBuilder.com.typesafe.config.ConfigException - if this is a acceptor connection or size
< zero.public EConfigure.PauseConfig build()
com.typesafe.config.ConfigException - if the pause configuration contains errors.Copyright © 2019. All rights reserved.