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.ObjectOptions that control the behavior of theReceivercreated 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 booleanautoAccept()ReceiverOptionsautoAccept(boolean autoAccept)Controls if the created Receiver will automatically accept the deliveries that have been received by the application (default istrue).booleanautoSettle()ReceiverOptionsautoSettle(boolean autoSettle)Controls if the created Receiver will automatically settle the deliveries that have been received by the application (default istrue).ReceiverOptionsclone()longcloseTimeout()ReceiverOptionscloseTimeout(long closeTimeout)Configures the timeout used when awaiting a response from the remote that a request to close theReceiverlink.ReceiverOptionscloseTimeout(long timeout, java.util.concurrent.TimeUnit units)Configures the timeout used when awaiting a response from the remote that a request to close theReceiverlink.protected ReceiverOptionscopyInto(ReceiverOptions other)Copy all options from thisReceiverOptionsinstance into the instance provided.intcreditWindow()ReceiverOptionscreditWindow(int creditWindow)A credit window value that will be used to maintain an window of credit for Receiver instances that are created.DeliveryModedeliveryMode()ReceiverOptionsdeliveryMode(DeliveryMode deliveryMode)Sets theDeliveryModevalue to assign to newly createdReceiverinstances.java.lang.String[]desiredCapabilities()ReceiverOptionsdesiredCapabilities(java.lang.String... desiredCapabilities)longdrainTimeout()ReceiverOptionsdrainTimeout(long drainTimeout)Sets the drain timeout (in milliseconds) after which aReceiverrequest to drain link credit is considered failed and the request will be marked as such.ReceiverOptionsdrainTimeout(long timeout, java.util.concurrent.TimeUnit units)Sets the drain timeout value after which aReceiverrequest to drain link credit is considered failed and the request will be marked as such.java.lang.StringlinkName()ReceiverOptionslinkName(java.lang.String linkName)Configures the link name to use when creating a givenReceiverinstance.java.lang.String[]offeredCapabilities()ReceiverOptionsofferedCapabilities(java.lang.String... offeredCapabilities)longopenTimeout()ReceiverOptionsopenTimeout(long openTimeout)Configures the timeout used when awaiting a response from the remote that a request to open aReceiverhas been honored.ReceiverOptionsopenTimeout(long timeout, java.util.concurrent.TimeUnit units)Configures the timeout used when awaiting a response from the remote that a request to open aReceiverhas been honored.java.util.Map<java.lang.String,java.lang.Object>properties()ReceiverOptionsproperties(java.util.Map<java.lang.String,java.lang.Object> properties)longrequestTimeout()ReceiverOptionsrequestTimeout(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.ReceiverOptionsrequestTimeout(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.SourceOptionssourceOptions()TargetOptionstargetOptions()
-
-
-
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
ReceiverOptionsinstance.
-
autoAccept
public boolean autoAccept()
- Returns:
- the current value of the
Receiverauto 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
ReceiverOptionsinstance.
-
autoSettle
public boolean autoSettle()
- Returns:
- the current value of the
Receiverauto settlement setting.
-
deliveryMode
public ReceiverOptions deliveryMode(DeliveryMode deliveryMode)
Sets theDeliveryModevalue to assign to newly createdReceiverinstances.- Parameters:
deliveryMode- The delivery mode value to configure.- Returns:
- this
ReceiverOptionsinstance.
-
deliveryMode
public DeliveryMode deliveryMode()
- Returns:
- the current value of the
Receiverdelivery mode configuration.
-
linkName
public ReceiverOptions linkName(java.lang.String linkName)
Configures the link name to use when creating a givenReceiverinstance.- Parameters:
linkName- The assigned link name to use when creating aReceiver.- Returns:
- this
ReceiverOptionsinstance.
-
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
Receiverinstances.
-
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. TheReceiverwill allow up to the credit window amount of incoming deliveries to be queued and as they are read from theReceiverthe 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
Receiverlink the credit window value should be set to zero.- Parameters:
creditWindow- The assigned credit window value to use.- Returns:
- this
ReceiverOptionsinstance.
-
closeTimeout
public long closeTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a
Receiveris closed.
-
closeTimeout
public ReceiverOptions closeTimeout(long closeTimeout)
Configures the timeout used when awaiting a response from the remote that a request to close theReceiverlink.- Parameters:
closeTimeout- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
ReceiverOptionsinstance.
-
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 theReceiverlink.- Parameters:
timeout- Timeout value to wait for a remote response.units- TheTimeUnitthat defines the timeout span.- Returns:
- this
ReceiverOptionsinstance.
-
openTimeout
public long openTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a
Receiveris opened.
-
openTimeout
public ReceiverOptions openTimeout(long openTimeout)
Configures the timeout used when awaiting a response from the remote that a request to open aReceiverhas been honored.- Parameters:
openTimeout- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
ReceiverOptionsinstance.
-
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 aReceiverhas been honored.- Parameters:
timeout- Timeout value to wait for a remote response.units- TheTimeUnitthat defines the timeout span.- Returns:
- this
ReceiverOptionsinstance.
-
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 aReceiverrequest 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
ReceiverOptionsinstance.
-
drainTimeout
public ReceiverOptions drainTimeout(long timeout, java.util.concurrent.TimeUnit units)
Sets the drain timeout value after which aReceiverrequest 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- TheTimeUnitthat defines the timeout span.- Returns:
- this
ReceiverOptionsinstance.
-
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
ReceiverOptionsinstance.
-
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- TheTimeUnitthat defines the timeout span.- Returns:
- this
ReceiverOptionsinstance.
-
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
ReceiverOptionsinstance.
-
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
ReceiverOptionsinstance.
-
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
ReceiverOptionsinstance.
-
sourceOptions
public SourceOptions sourceOptions()
- Returns:
- the source options that will be used when creating new
Receiverinstances.
-
targetOptions
public TargetOptions targetOptions()
- Returns:
- the target options that will be used when creating new
Senderinstances.
-
clone
public ReceiverOptions clone()
- Overrides:
clonein classjava.lang.Object
-
copyInto
protected ReceiverOptions copyInto(ReceiverOptions other)
Copy all options from thisReceiverOptionsinstance into the instance provided.- Parameters:
other- the target of this copy operation.- Returns:
- this options class for chaining.
-
-