Package org.apache.qpid.protonj2.client
Class SenderOptions
java.lang.Object
org.apache.qpid.protonj2.client.LinkOptions<SenderOptions>
org.apache.qpid.protonj2.client.SenderOptions
- All Implemented Interfaces:
Cloneable
Options that control the behavior of a
Sender created from them.-
Constructor Summary
ConstructorsConstructorDescriptionCreate 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
Modifier and TypeMethodDescriptionclone()protected SenderOptionscopyInto(SenderOptions other) Copy all options from thisSenderOptionsinstance into the instance provided.Configures aSupplierwhich provides unique instances ofDeliveryTagGeneratorobjects for anySendercreated using these options.protected SenderOptionsself()longsendTimeout(long sendTimeout) Configures the timeout used when awaiting a send operation to complete.sendTimeout(long timeout, TimeUnit units) Configures the timeout used when awaiting a send operation to complete.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 Details
-
SenderOptions
public SenderOptions()Create a newSenderOptionsinstance configured with default configuration settings. -
SenderOptions
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 Details
-
sendTimeout
public long sendTimeout()- Returns:
- the timeout used when awaiting a response from the remote when a resource is message send.
-
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
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.
-
clone
-
copyInto
Copy all options from thisSenderOptionsinstance into the instance provided.- Parameters:
other- the target of this copy operation.- Returns:
- the
SenderOptionsinstance that was given.
-
deliveryTagGeneratorSupplier
Configures aSupplierwhich provides unique instances ofDeliveryTagGeneratorobjects for anySendercreated using these options.The client sender will use a default
DeliveryTagGeneratorunder normal circumstances and the user is not required to configure aSupplier. In some cases where the user is communicating with a system that requires a specific format of delivery tag this option allows use of a custom generator. The caller is responsible for providing a supplier that will create a unique instance of a tag generator as they are not meant to be shared amongst senders. Once a sender has been created the tag generator it uses cannot be changed so future calls to this method will not affect previously createdSenderinstances.- Parameters:
supplier- TheSupplierofDeliveryTagGeneratorinstances.- Returns:
- the
SenderOptionsinstance that was given.
-
deliveryTagGeneratorSupplier
- Returns:
- the configured delivery tag
Supplieror null if none was set.
-
self
- Specified by:
selfin classLinkOptions<SenderOptions>- Returns:
- the true derived type instance for use in this class.
-