Package org.apache.qpid.protonj2.client
Class ReceiverOptions
- java.lang.Object
-
- org.apache.qpid.protonj2.client.ReceiverOptions
-
- Direct Known Subclasses:
StreamReceiverOptions
public class ReceiverOptions extends java.lang.Object
Options that control the behavior of theReceiver
created from them.
-
-
Constructor Summary
Constructors Constructor Description ReceiverOptions()
Create a new ReceiverOptions instance with defaults set for all options.ReceiverOptions(ReceiverOptions options)
Create a new ReceiverOptions instance that copies the configuration from the specified source options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
autoAccept()
ReceiverOptions
autoAccept(boolean autoAccept)
Controls if the created Receiver will automatically accept the deliveries that have been received by the application (default istrue
).boolean
autoSettle()
ReceiverOptions
autoSettle(boolean autoSettle)
Controls if the created Receiver will automatically settle the deliveries that have been received by the application (default istrue
).ReceiverOptions
clone()
long
closeTimeout()
ReceiverOptions
closeTimeout(long closeTimeout)
Configures the timeout used when awaiting a response from the remote that a request to close theReceiver
link.ReceiverOptions
closeTimeout(long timeout, java.util.concurrent.TimeUnit units)
Configures the timeout used when awaiting a response from the remote that a request to close theReceiver
link.protected ReceiverOptions
copyInto(ReceiverOptions other)
Copy all options from thisReceiverOptions
instance into the instance provided.int
creditWindow()
ReceiverOptions
creditWindow(int creditWindow)
A credit window value that will be used to maintain an window of credit for Receiver instances that are created.DeliveryMode
deliveryMode()
ReceiverOptions
deliveryMode(DeliveryMode deliveryMode)
Sets theDeliveryMode
value to assign to newly createdReceiver
instances.java.lang.String[]
desiredCapabilities()
ReceiverOptions
desiredCapabilities(java.lang.String... desiredCapabilities)
long
drainTimeout()
ReceiverOptions
drainTimeout(long drainTimeout)
Sets the drain timeout (in milliseconds) after which aReceiver
request to drain link credit is considered failed and the request will be marked as such.ReceiverOptions
drainTimeout(long timeout, java.util.concurrent.TimeUnit units)
Sets the drain timeout value after which aReceiver
request to drain link credit is considered failed and the request will be marked as such.java.lang.String
linkName()
ReceiverOptions
linkName(java.lang.String linkName)
Configures the link name to use when creating a givenReceiver
instance.java.lang.String[]
offeredCapabilities()
ReceiverOptions
offeredCapabilities(java.lang.String... offeredCapabilities)
long
openTimeout()
ReceiverOptions
openTimeout(long openTimeout)
Configures the timeout used when awaiting a response from the remote that a request to open aReceiver
has been honored.ReceiverOptions
openTimeout(long timeout, java.util.concurrent.TimeUnit units)
Configures the timeout used when awaiting a response from the remote that a request to open aReceiver
has been honored.java.util.Map<java.lang.String,java.lang.Object>
properties()
ReceiverOptions
properties(java.util.Map<java.lang.String,java.lang.Object> properties)
long
requestTimeout()
ReceiverOptions
requestTimeout(long requestTimeout)
Configures the timeout used when awaiting a response from the remote that a request to perform some action such as starting a new transaction.ReceiverOptions
requestTimeout(long timeout, java.util.concurrent.TimeUnit units)
Configures the timeout used when awaiting a response from the remote that a request to perform some action such as starting a new transaction.SourceOptions
sourceOptions()
TargetOptions
targetOptions()
-
-
-
Constructor Detail
-
ReceiverOptions
public ReceiverOptions()
Create a new ReceiverOptions instance with defaults set for all options.
-
ReceiverOptions
public ReceiverOptions(ReceiverOptions options)
Create a new ReceiverOptions instance that copies the configuration from the specified source options.- Parameters:
options
- The ReceiverOptions instance whose settings are to be copied into this one.
-
-
Method Detail
-
autoAccept
public ReceiverOptions autoAccept(boolean autoAccept)
Controls if the created Receiver will automatically accept the deliveries that have been received by the application (default istrue
).- Parameters:
autoAccept
- The value to assign for auto delivery acceptance.- Returns:
- this
ReceiverOptions
instance.
-
autoAccept
public boolean autoAccept()
- Returns:
- the current value of the
Receiver
auto accept setting.
-
autoSettle
public ReceiverOptions autoSettle(boolean autoSettle)
Controls if the created Receiver will automatically settle the deliveries that have been received by the application (default istrue
).- Parameters:
autoSettle
- The value to assign for auto delivery settlement.- Returns:
- this
ReceiverOptions
instance.
-
autoSettle
public boolean autoSettle()
- Returns:
- the current value of the
Receiver
auto settlement setting.
-
deliveryMode
public ReceiverOptions deliveryMode(DeliveryMode deliveryMode)
Sets theDeliveryMode
value to assign to newly createdReceiver
instances.- Parameters:
deliveryMode
- The delivery mode value to configure.- Returns:
- this
ReceiverOptions
instance.
-
deliveryMode
public DeliveryMode deliveryMode()
- Returns:
- the current value of the
Receiver
delivery mode configuration.
-
linkName
public ReceiverOptions linkName(java.lang.String linkName)
Configures the link name to use when creating a givenReceiver
instance.- Parameters:
linkName
- The assigned link name to use when creating aReceiver
.- Returns:
- this
ReceiverOptions
instance.
-
linkName
public java.lang.String linkName()
- Returns:
- the configured link name to use when creating a
Receiver
.
-
creditWindow
public int creditWindow()
- Returns:
- the credit window configuration that will be applied to created
Receiver
instances.
-
creditWindow
public ReceiverOptions creditWindow(int creditWindow)
A credit window value that will be used to maintain an window of credit for Receiver instances that are created. TheReceiver
will allow up to the credit window amount of incoming deliveries to be queued and as they are read from theReceiver
the window will be extended to maintain a consistent backlog of deliveries. The default is to configure a credit window of 10.To disable credit windowing and allow the client application to control the credit on the
Receiver
link the credit window value should be set to zero.- Parameters:
creditWindow
- The assigned credit window value to use.- Returns:
- this
ReceiverOptions
instance.
-
closeTimeout
public long closeTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a
Receiver
is closed.
-
closeTimeout
public ReceiverOptions closeTimeout(long closeTimeout)
Configures the timeout used when awaiting a response from the remote that a request to close theReceiver
link.- Parameters:
closeTimeout
- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
ReceiverOptions
instance.
-
closeTimeout
public ReceiverOptions closeTimeout(long timeout, java.util.concurrent.TimeUnit units)
Configures the timeout used when awaiting a response from the remote that a request to close theReceiver
link.- Parameters:
timeout
- Timeout value to wait for a remote response.units
- TheTimeUnit
that defines the timeout span.- Returns:
- this
ReceiverOptions
instance.
-
openTimeout
public long openTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a
Receiver
is opened.
-
openTimeout
public ReceiverOptions openTimeout(long openTimeout)
Configures the timeout used when awaiting a response from the remote that a request to open aReceiver
has been honored.- Parameters:
openTimeout
- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
ReceiverOptions
instance.
-
openTimeout
public ReceiverOptions openTimeout(long timeout, java.util.concurrent.TimeUnit units)
Configures the timeout used when awaiting a response from the remote that a request to open aReceiver
has been honored.- Parameters:
timeout
- Timeout value to wait for a remote response.units
- TheTimeUnit
that defines the timeout span.- Returns:
- this
ReceiverOptions
instance.
-
drainTimeout
public long drainTimeout()
- Returns:
- the configured drain timeout value that will use to fail a pending drain request.
-
drainTimeout
public ReceiverOptions drainTimeout(long drainTimeout)
Sets the drain timeout (in milliseconds) after which aReceiver
request to drain link credit is considered failed and the request will be marked as such.- Parameters:
drainTimeout
- the drainTimeout to use for receiver links.- Returns:
- this
ReceiverOptions
instance.
-
drainTimeout
public ReceiverOptions drainTimeout(long timeout, java.util.concurrent.TimeUnit units)
Sets the drain timeout value after which aReceiver
request to drain link credit is considered failed and the request will be marked as such.- Parameters:
timeout
- Timeout value to wait for a remote response.units
- TheTimeUnit
that defines the timeout span.- Returns:
- this
ReceiverOptions
instance.
-
requestTimeout
public long requestTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a resource makes a request.
-
requestTimeout
public ReceiverOptions requestTimeout(long requestTimeout)
Configures the timeout used when awaiting a response from the remote that a request to perform some action such as starting a new transaction. If the remote does not respond within the configured timeout the resource making the request will mark it as failed and return an error to the request initiator usually in the form of aClientOperationTimedOutException
.- Parameters:
requestTimeout
- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
ReceiverOptions
instance.
-
requestTimeout
public ReceiverOptions requestTimeout(long timeout, java.util.concurrent.TimeUnit units)
Configures the timeout used when awaiting a response from the remote that a request to perform some action such as starting a new transaction. If the remote does not respond within the configured timeout the resource making the request will mark it as failed and return an error to the request initiator usually in the form of aClientOperationTimedOutException
.- Parameters:
timeout
- Timeout value to wait for a remote response.units
- TheTimeUnit
that defines the timeout span.- Returns:
- this
ReceiverOptions
instance.
-
offeredCapabilities
public java.lang.String[] offeredCapabilities()
- Returns:
- the offeredCapabilities
-
offeredCapabilities
public ReceiverOptions offeredCapabilities(java.lang.String... offeredCapabilities)
- Parameters:
offeredCapabilities
- the offeredCapabilities to set- Returns:
- this
ReceiverOptions
instance.
-
desiredCapabilities
public java.lang.String[] desiredCapabilities()
- Returns:
- the desiredCapabilities
-
desiredCapabilities
public ReceiverOptions desiredCapabilities(java.lang.String... desiredCapabilities)
- Parameters:
desiredCapabilities
- the desiredCapabilities to set- Returns:
- this
ReceiverOptions
instance.
-
properties
public java.util.Map<java.lang.String,java.lang.Object> properties()
- Returns:
- the properties
-
properties
public ReceiverOptions properties(java.util.Map<java.lang.String,java.lang.Object> properties)
- Parameters:
properties
- the properties to set- Returns:
- this
ReceiverOptions
instance.
-
sourceOptions
public SourceOptions sourceOptions()
- Returns:
- the source options that will be used when creating new
Receiver
instances.
-
targetOptions
public TargetOptions targetOptions()
- Returns:
- the target options that will be used when creating new
Sender
instances.
-
clone
public ReceiverOptions clone()
- Overrides:
clone
in classjava.lang.Object
-
copyInto
protected ReceiverOptions copyInto(ReceiverOptions other)
Copy all options from thisReceiverOptions
instance into the instance provided.- Parameters:
other
- the target of this copy operation.- Returns:
- this options class for chaining.
-
-