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.Object
Options that control the behavior of aSender
created from them.
-
-
Constructor Summary
Constructors Constructor Description SenderOptions()
Create a newSenderOptions
instance 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 boolean
autoSettle()
Get whether theSender
is auto settling deliveries.SenderOptions
autoSettle(boolean autoSettle)
Sets whether sent deliveries should be automatically locally-settled once they have become remotely-settled by the receiving peer.SenderOptions
clone()
long
closeTimeout()
SenderOptions
closeTimeout(long closeTimeout)
Configures the timeout used when awaiting a response from the remote that a request to close theSender
link.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 theSender
link.protected SenderOptions
copyInto(SenderOptions other)
Copy all options from thisSenderOptions
instance into the instance provided.DeliveryMode
deliveryMode()
SenderOptions
deliveryMode(DeliveryMode deliveryMode)
Sets theDeliveryMode
value to assign to newly createdSender
instances.java.lang.String[]
desiredCapabilities()
SenderOptions
desiredCapabilities(java.lang.String... desiredCapabilities)
java.lang.String
linkName()
SenderOptions
linkName(java.lang.String linkName)
Configures the link name to use when creating a givenSender
instance.java.lang.String[]
offeredCapabilities()
SenderOptions
offeredCapabilities(java.lang.String... offeredCapabilities)
long
openTimeout()
SenderOptions
openTimeout(long openTimeout)
Configures the timeout used when awaiting a response from the remote that a request to open aSender
has been honored.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 aSender
has been honored.java.util.Map<java.lang.String,java.lang.Object>
properties()
SenderOptions
properties(java.util.Map<java.lang.String,java.lang.Object> properties)
long
requestTimeout()
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.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.long
sendTimeout()
SenderOptions
sendTimeout(long sendTimeout)
Configures the timeout used when awaiting a send operation to complete.SenderOptions
sendTimeout(long timeout, java.util.concurrent.TimeUnit units)
Configures the timeout used when awaiting a send operation to complete.SourceOptions
sourceOptions()
TargetOptions
targetOptions()
-
-
-
Constructor Detail
-
SenderOptions
public SenderOptions()
Create a newSenderOptions
instance 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 givenSender
instance.- Parameters:
linkName
- The assigned link name to use when creating aSender
.- Returns:
- this
SenderOptions
instance.
-
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 theSender
is 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 theDeliveryMode
value to assign to newly createdSender
instances.- Parameters:
deliveryMode
- The delivery mode value to configure.- Returns:
- this
SenderOptions
instance.
-
deliveryMode
public DeliveryMode deliveryMode()
- Returns:
- the current value of the
Sender
delivery mode configuration.
-
closeTimeout
public long closeTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a
Sender
is closed.
-
closeTimeout
public SenderOptions closeTimeout(long closeTimeout)
Configures the timeout used when awaiting a response from the remote that a request to close theSender
link.- Parameters:
closeTimeout
- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
SenderOptions
instance.
-
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 theSender
link.- Parameters:
timeout
- Timeout value to wait for a remote response.units
- TheTimeUnit
that defines the timeout span.- Returns:
- this
SenderOptions
instance.
-
openTimeout
public long openTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a
Sender
is opened.
-
openTimeout
public SenderOptions openTimeout(long openTimeout)
Configures the timeout used when awaiting a response from the remote that a request to open aSender
has been honored.- Parameters:
openTimeout
- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
SenderOptions
instance.
-
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 aSender
has been honored.- Parameters:
timeout
- Timeout value to wait for a remote response.units
- TheTimeUnit
that defines the timeout span.- Returns:
- this
SenderOptions
instance.
-
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 theSender
or theSession
credit to do so, if the send blocks for longer than this timeout the send call will fail with anClientSendTimedOutException
exception to indicate that the send did not complete.- Parameters:
sendTimeout
- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
SenderOptions
instance.
-
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 theSender
or theSession
credit to do so, if the send blocks for longer than this timeout the send call will fail with anClientSendTimedOutException
exception to indicate that the send did not complete.- Parameters:
timeout
- Timeout value to wait for a remote response.units
- TheTimeUnit
that defines the timeout span.- Returns:
- this
SenderOptions
instance.
-
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
SenderOptions
instance.
-
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
- TheTimeUnit
that defines the timeout span.- Returns:
- this
SenderOptions
instance.
-
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
SenderOptions
instance.
-
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
SenderOptions
instance.
-
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
SenderOptions
instance.
-
sourceOptions
public SourceOptions sourceOptions()
- Returns:
- the source
-
targetOptions
public TargetOptions targetOptions()
- Returns:
- the target
-
clone
public SenderOptions clone()
- Overrides:
clone
in classjava.lang.Object
-
copyInto
protected SenderOptions copyInto(SenderOptions other)
Copy all options from thisSenderOptions
instance into the instance provided.- Parameters:
other
- the target of this copy operation.- Returns:
- this options class for chaining.
-
-