Package org.apache.qpid.protonj2.client
Class SenderOptions
- java.lang.Object
-
- org.apache.qpid.protonj2.client.SenderOptions
-
- Direct Known Subclasses:
StreamSenderOptions
public class SenderOptions extends java.lang.ObjectOptions that control the behavior of aSendercreated from them.
-
-
Constructor Summary
Constructors Constructor Description SenderOptions()Create a newSenderOptionsinstance configured with default configuration settings.SenderOptions(SenderOptions options)Create a new SenderOptions instance that copies the configuration from the specified source options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanautoSettle()Get whether theSenderis auto settling deliveries.SenderOptionsautoSettle(boolean autoSettle)Sets whether sent deliveries should be automatically locally-settled once they have become remotely-settled by the receiving peer.SenderOptionsclone()longcloseTimeout()SenderOptionscloseTimeout(long closeTimeout)Configures the timeout used when awaiting a response from the remote that a request to close theSenderlink.SenderOptionscloseTimeout(long timeout, java.util.concurrent.TimeUnit units)Configures the timeout used when awaiting a response from the remote that a request to close theSenderlink.protected SenderOptionscopyInto(SenderOptions other)Copy all options from thisSenderOptionsinstance into the instance provided.DeliveryModedeliveryMode()SenderOptionsdeliveryMode(DeliveryMode deliveryMode)Sets theDeliveryModevalue to assign to newly createdSenderinstances.java.lang.String[]desiredCapabilities()SenderOptionsdesiredCapabilities(java.lang.String... desiredCapabilities)java.lang.StringlinkName()SenderOptionslinkName(java.lang.String linkName)Configures the link name to use when creating a givenSenderinstance.java.lang.String[]offeredCapabilities()SenderOptionsofferedCapabilities(java.lang.String... offeredCapabilities)longopenTimeout()SenderOptionsopenTimeout(long openTimeout)Configures the timeout used when awaiting a response from the remote that a request to open aSenderhas been honored.SenderOptionsopenTimeout(long timeout, java.util.concurrent.TimeUnit units)Configures the timeout used when awaiting a response from the remote that a request to open aSenderhas been honored.java.util.Map<java.lang.String,java.lang.Object>properties()SenderOptionsproperties(java.util.Map<java.lang.String,java.lang.Object> properties)longrequestTimeout()SenderOptionsrequestTimeout(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.SenderOptionsrequestTimeout(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.longsendTimeout()SenderOptionssendTimeout(long sendTimeout)Configures the timeout used when awaiting a send operation to complete.SenderOptionssendTimeout(long timeout, java.util.concurrent.TimeUnit units)Configures the timeout used when awaiting a send operation to complete.SourceOptionssourceOptions()TargetOptionstargetOptions()
-
-
-
Constructor Detail
-
SenderOptions
public SenderOptions()
Create a newSenderOptionsinstance configured with default configuration settings.
-
SenderOptions
public SenderOptions(SenderOptions options)
Create a new SenderOptions instance that copies the configuration from the specified source options.- Parameters:
options- The SenderOptions instance whose settings are to be copied into this one.
-
-
Method Detail
-
linkName
public SenderOptions linkName(java.lang.String linkName)
Configures the link name to use when creating a givenSenderinstance.- Parameters:
linkName- The assigned link name to use when creating aSender.- Returns:
- this
SenderOptionsinstance.
-
linkName
public java.lang.String linkName()
- Returns:
- the configured link name to use when creating a
Sender.
-
autoSettle
public SenderOptions autoSettle(boolean autoSettle)
Sets whether sent deliveries should be automatically locally-settled once they have become remotely-settled by the receiving peer. True by default.- Parameters:
autoSettle- whether deliveries should be auto settled locally after being settled by the receiver- Returns:
- the sender
-
autoSettle
public boolean autoSettle()
Get whether theSenderis auto settling deliveries.- Returns:
- whether deliveries should be auto settled locally after being settled by the receiver
- See Also:
autoSettle(boolean)
-
deliveryMode
public SenderOptions deliveryMode(DeliveryMode deliveryMode)
Sets theDeliveryModevalue to assign to newly createdSenderinstances.- Parameters:
deliveryMode- The delivery mode value to configure.- Returns:
- this
SenderOptionsinstance.
-
deliveryMode
public DeliveryMode deliveryMode()
- Returns:
- the current value of the
Senderdelivery mode configuration.
-
closeTimeout
public long closeTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a
Senderis closed.
-
closeTimeout
public SenderOptions closeTimeout(long closeTimeout)
Configures the timeout used when awaiting a response from the remote that a request to close theSenderlink.- Parameters:
closeTimeout- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
SenderOptionsinstance.
-
closeTimeout
public SenderOptions closeTimeout(long timeout, java.util.concurrent.TimeUnit units)
Configures the timeout used when awaiting a response from the remote that a request to close theSenderlink.- Parameters:
timeout- Timeout value to wait for a remote response.units- TheTimeUnitthat defines the timeout span.- Returns:
- this
SenderOptionsinstance.
-
openTimeout
public long openTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a
Senderis opened.
-
openTimeout
public SenderOptions openTimeout(long openTimeout)
Configures the timeout used when awaiting a response from the remote that a request to open aSenderhas been honored.- Parameters:
openTimeout- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
SenderOptionsinstance.
-
openTimeout
public SenderOptions openTimeout(long timeout, java.util.concurrent.TimeUnit units)
Configures the timeout used when awaiting a response from the remote that a request to open aSenderhas been honored.- Parameters:
timeout- Timeout value to wait for a remote response.units- TheTimeUnitthat defines the timeout span.- Returns:
- this
SenderOptionsinstance.
-
sendTimeout
public long sendTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a resource is message send.
-
sendTimeout
public SenderOptions sendTimeout(long sendTimeout)
Configures the timeout used when awaiting a send operation to complete. A send will block if the remote has not granted theSenderor theSessioncredit to do so, if the send blocks for longer than this timeout the send call will fail with anClientSendTimedOutExceptionexception to indicate that the send did not complete.- Parameters:
sendTimeout- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
SenderOptionsinstance.
-
sendTimeout
public SenderOptions sendTimeout(long timeout, java.util.concurrent.TimeUnit units)
Configures the timeout used when awaiting a send operation to complete. A send will block if the remote has not granted theSenderor theSessioncredit to do so, if the send blocks for longer than this timeout the send call will fail with anClientSendTimedOutExceptionexception to indicate that the send did not complete.- Parameters:
timeout- Timeout value to wait for a remote response.units- TheTimeUnitthat defines the timeout span.- Returns:
- this
SenderOptionsinstance.
-
requestTimeout
public long requestTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a resource makes a request.
-
requestTimeout
public SenderOptions 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
SenderOptionsinstance.
-
requestTimeout
public SenderOptions 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
SenderOptionsinstance.
-
offeredCapabilities
public java.lang.String[] offeredCapabilities()
- Returns:
- the offeredCapabilities
-
offeredCapabilities
public SenderOptions offeredCapabilities(java.lang.String... offeredCapabilities)
- Parameters:
offeredCapabilities- the offeredCapabilities to set- Returns:
- this
SenderOptionsinstance.
-
desiredCapabilities
public java.lang.String[] desiredCapabilities()
- Returns:
- the desiredCapabilities
-
desiredCapabilities
public SenderOptions desiredCapabilities(java.lang.String... desiredCapabilities)
- Parameters:
desiredCapabilities- the desiredCapabilities to set- Returns:
- this
SenderOptionsinstance.
-
properties
public java.util.Map<java.lang.String,java.lang.Object> properties()
- Returns:
- the properties
-
properties
public SenderOptions properties(java.util.Map<java.lang.String,java.lang.Object> properties)
- Parameters:
properties- the properties to set- Returns:
- this
SenderOptionsinstance.
-
sourceOptions
public SourceOptions sourceOptions()
- Returns:
- the source
-
targetOptions
public TargetOptions targetOptions()
- Returns:
- the target
-
clone
public SenderOptions clone()
- Overrides:
clonein classjava.lang.Object
-
copyInto
protected SenderOptions copyInto(SenderOptions other)
Copy all options from thisSenderOptionsinstance into the instance provided.- Parameters:
other- the target of this copy operation.- Returns:
- this options class for chaining.
-
-