Package org.apache.qpid.protonj2.client
Class LinkOptions<T extends LinkOptions<T>>
java.lang.Object
org.apache.qpid.protonj2.client.LinkOptions<T>
- Type Parameters:
T
- The actualLinkOptions
concrete type (SenderOptions or ReceiverOptions).
- Direct Known Subclasses:
ReceiverOptions
,SenderOptions
,StreamReceiverOptions
,StreamSenderOptions
Base options that are applied to AMQP link types.
-
Constructor Summary
ConstructorDescriptionCreate a new LinkOptions instance with defaults set for all options.LinkOptions
(LinkOptions<T> options) Create a new LinkOptions instance that copies the configuration from the specified source options. -
Method Summary
Modifier and TypeMethodDescriptionboolean
autoSettle
(boolean autoSettle) Controls if the created Link will automatically settle the deliveries that have been received by the application (default istrue
).long
closeTimeout
(long closeTimeout) Configures the timeout used when awaiting a response from the remote that a request to close theLink
link.closeTimeout
(long timeout, TimeUnit units) Configures the timeout used when awaiting a response from the remote that a request to close theLink
link.protected LinkOptions
<T> copyInto
(LinkOptions<T> other) Copy all options from thisLinkOptions
instance into the instance provided.deliveryMode
(DeliveryMode deliveryMode) Sets theDeliveryMode
value to assign to newly createdLink
instances.String[]
desiredCapabilities
(String... desiredCapabilities) linkName()
Configures the link name to use when creating a givenLink
instance.String[]
offeredCapabilities
(String... offeredCapabilities) long
openTimeout
(long openTimeout) Configures the timeout used when awaiting a response from the remote that a request to open aLink
has been honored.openTimeout
(long timeout, TimeUnit units) Configures the timeout used when awaiting a response from the remote that a request to open aLink
has been honored.properties
(Map<String, Object> properties) long
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.requestTimeout
(long timeout, 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.protected abstract T
self()
-
Constructor Details
-
LinkOptions
public LinkOptions()Create a new LinkOptions instance with defaults set for all options. -
LinkOptions
Create a new LinkOptions instance that copies the configuration from the specified source options.- Parameters:
options
- The LinkOptions instance whose settings are to be copied into this one.
-
-
Method Details
-
autoSettle
Controls if the created Link will automatically settle the deliveries that have been received by the application (default istrue
). This option will also result in an accepted outcome being applied to the settled delivery.- Parameters:
autoSettle
- The value to assign for auto delivery settlement.- Returns:
- this
LinkOptions
instance.
-
autoSettle
public boolean autoSettle()- Returns:
- the current value of the
Link
auto settlement setting.
-
deliveryMode
Sets theDeliveryMode
value to assign to newly createdLink
instances.- Parameters:
deliveryMode
- The delivery mode value to configure.- Returns:
- this
LinkOptions
instance.
-
deliveryMode
- Returns:
- the current value of the
Link
delivery mode configuration.
-
linkName
Configures the link name to use when creating a givenLink
instance.- Parameters:
linkName
- The assigned link name to use when creating aLink
.- Returns:
- this
LinkOptions
instance.
-
linkName
- Returns:
- the configured link name to use when creating a
Link
.
-
closeTimeout
public long closeTimeout()- Returns:
- the timeout used when awaiting a response from the remote when a
Link
is closed.
-
closeTimeout
Configures the timeout used when awaiting a response from the remote that a request to close theLink
link.- Parameters:
closeTimeout
- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
ReceiverOptions
instance.
-
closeTimeout
Configures the timeout used when awaiting a response from the remote that a request to close theLink
link.- Parameters:
timeout
- Timeout value to wait for a remote response.units
- TheTimeUnit
that defines the timeout span.- Returns:
- this
LinkOptions
instance.
-
openTimeout
public long openTimeout()- Returns:
- the timeout used when awaiting a response from the remote when a
Link
is opened.
-
openTimeout
Configures the timeout used when awaiting a response from the remote that a request to open aLink
has been honored.- Parameters:
openTimeout
- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
LinkOptions
instance.
-
openTimeout
Configures the timeout used when awaiting a response from the remote that a request to open aLink
has been honored.- Parameters:
timeout
- Timeout value to wait for a remote response.units
- TheTimeUnit
that defines the timeout span.- Returns:
- this
LinkOptions
instance.
-
requestTimeout
public long requestTimeout()- Returns:
- the timeout used when awaiting a response from the remote when a resource makes a request.
-
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
LinkOptions
instance.
-
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:
timeout
- Timeout value to wait for a remote response.units
- TheTimeUnit
that defines the timeout span.- Returns:
- this
LinkOptions
instance.
-
offeredCapabilities
- Returns:
- the offeredCapabilities
-
offeredCapabilities
- Parameters:
offeredCapabilities
- the offeredCapabilities to set- Returns:
- this
LinkOptions
instance.
-
desiredCapabilities
- Returns:
- the desiredCapabilities
-
desiredCapabilities
- Parameters:
desiredCapabilities
- the desiredCapabilities to set- Returns:
- this
LinkOptions
instance.
-
properties
- Returns:
- the properties
-
properties
- Parameters:
properties
- the properties to set- Returns:
- this
LinkOptions
instance.
-
sourceOptions
- Returns:
- the source options that will be used when creating new
Link
instances.
-
targetOptions
- Returns:
- the target options that will be used when creating new
Sender
instances.
-
copyInto
Copy all options from thisLinkOptions
instance into the instance provided.- Parameters:
other
- the target of this copy operation.- Returns:
- this options class for chaining.
-
self
- Returns:
- the true derived type instance for use in this class.
-