Package org.apache.qpid.protonj2.client
Class ReceiverOptions
- java.lang.Object
-
- org.apache.qpid.protonj2.client.LinkOptions<ReceiverOptions>
-
- org.apache.qpid.protonj2.client.ReceiverOptions
-
- All Implemented Interfaces:
Cloneable
public class ReceiverOptions extends LinkOptions<ReceiverOptions> implements Cloneable
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
).ReceiverOptions
clone()
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.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, 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.protected ReceiverOptions
self()
-
Methods inherited from class org.apache.qpid.protonj2.client.LinkOptions
autoSettle, autoSettle, closeTimeout, closeTimeout, closeTimeout, copyInto, deliveryMode, deliveryMode, desiredCapabilities, desiredCapabilities, linkName, linkName, offeredCapabilities, offeredCapabilities, openTimeout, openTimeout, openTimeout, properties, properties, requestTimeout, requestTimeout, requestTimeout, sourceOptions, 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.
-
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.
-
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, 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.
-
clone
public ReceiverOptions clone()
-
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:
- the
ReceiverOptions
instance that was given.
-
self
protected ReceiverOptions self()
- Specified by:
self
in classLinkOptions<ReceiverOptions>
- Returns:
- the true derived type instance for use in this class.
-
-