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 actualLinkOptionsconcrete type (SenderOptions or ReceiverOptions).
- Direct Known Subclasses:
ReceiverOptions,SenderOptions,StreamReceiverOptions,StreamSenderOptions
public abstract class LinkOptions<T extends LinkOptions<T>> extends Object
Base options that are applied to AMQP link types.
-
-
Constructor Summary
Constructors Constructor Description LinkOptions()Create 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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanautoSettle()TautoSettle(boolean autoSettle)Controls if the created Link will automatically settle the deliveries that have been received by the application (default istrue).longcloseTimeout()TcloseTimeout(long closeTimeout)Configures the timeout used when awaiting a response from the remote that a request to close theLinklink.TcloseTimeout(long timeout, TimeUnit units)Configures the timeout used when awaiting a response from the remote that a request to close theLinklink.protected LinkOptions<T>copyInto(LinkOptions<T> other)Copy all options from thisLinkOptionsinstance into the instance provided.DeliveryModedeliveryMode()TdeliveryMode(DeliveryMode deliveryMode)Sets theDeliveryModevalue to assign to newly createdLinkinstances.String[]desiredCapabilities()TdesiredCapabilities(String... desiredCapabilities)StringlinkName()TlinkName(String linkName)Configures the link name to use when creating a givenLinkinstance.String[]offeredCapabilities()TofferedCapabilities(String... offeredCapabilities)longopenTimeout()TopenTimeout(long openTimeout)Configures the timeout used when awaiting a response from the remote that a request to open aLinkhas been honored.TopenTimeout(long timeout, TimeUnit units)Configures the timeout used when awaiting a response from the remote that a request to open aLinkhas been honored.Map<String,Object>properties()Tproperties(Map<String,Object> properties)longrequestTimeout()TrequestTimeout(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.TrequestTimeout(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 Tself()SourceOptionssourceOptions()TargetOptionstargetOptions()
-
-
-
Constructor Detail
-
LinkOptions
public LinkOptions()
Create a new LinkOptions instance with defaults set for all options.
-
LinkOptions
public LinkOptions(LinkOptions<T> options)
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 Detail
-
autoSettle
public T autoSettle(boolean autoSettle)
Controls if the created Link 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
LinkOptionsinstance.
-
autoSettle
public boolean autoSettle()
- Returns:
- the current value of the
Linkauto settlement setting.
-
deliveryMode
public T deliveryMode(DeliveryMode deliveryMode)
Sets theDeliveryModevalue to assign to newly createdLinkinstances.- Parameters:
deliveryMode- The delivery mode value to configure.- Returns:
- this
LinkOptionsinstance.
-
deliveryMode
public DeliveryMode deliveryMode()
- Returns:
- the current value of the
Linkdelivery mode configuration.
-
linkName
public T linkName(String linkName)
Configures the link name to use when creating a givenLinkinstance.- Parameters:
linkName- The assigned link name to use when creating aLink.- Returns:
- this
LinkOptionsinstance.
-
closeTimeout
public long closeTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a
Linkis closed.
-
closeTimeout
public T closeTimeout(long closeTimeout)
Configures the timeout used when awaiting a response from the remote that a request to close theLinklink.- Parameters:
closeTimeout- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
ReceiverOptionsinstance.
-
closeTimeout
public T closeTimeout(long timeout, TimeUnit units)
Configures the timeout used when awaiting a response from the remote that a request to close theLinklink.- Parameters:
timeout- Timeout value to wait for a remote response.units- TheTimeUnitthat defines the timeout span.- Returns:
- this
LinkOptionsinstance.
-
openTimeout
public long openTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a
Linkis opened.
-
openTimeout
public T openTimeout(long openTimeout)
Configures the timeout used when awaiting a response from the remote that a request to open aLinkhas been honored.- Parameters:
openTimeout- Timeout value in milliseconds to wait for a remote response.- Returns:
- this
LinkOptionsinstance.
-
openTimeout
public T openTimeout(long timeout, TimeUnit units)
Configures the timeout used when awaiting a response from the remote that a request to open aLinkhas been honored.- Parameters:
timeout- Timeout value to wait for a remote response.units- TheTimeUnitthat defines the timeout span.- Returns:
- this
LinkOptionsinstance.
-
requestTimeout
public long requestTimeout()
- Returns:
- the timeout used when awaiting a response from the remote when a resource makes a request.
-
requestTimeout
public T 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
LinkOptionsinstance.
-
requestTimeout
public T 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. 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
LinkOptionsinstance.
-
offeredCapabilities
public String[] offeredCapabilities()
- Returns:
- the offeredCapabilities
-
offeredCapabilities
public T offeredCapabilities(String... offeredCapabilities)
- Parameters:
offeredCapabilities- the offeredCapabilities to set- Returns:
- this
LinkOptionsinstance.
-
desiredCapabilities
public String[] desiredCapabilities()
- Returns:
- the desiredCapabilities
-
desiredCapabilities
public T desiredCapabilities(String... desiredCapabilities)
- Parameters:
desiredCapabilities- the desiredCapabilities to set- Returns:
- this
LinkOptionsinstance.
-
properties
public T properties(Map<String,Object> properties)
- Parameters:
properties- the properties to set- Returns:
- this
LinkOptionsinstance.
-
sourceOptions
public SourceOptions sourceOptions()
- Returns:
- the source options that will be used when creating new
Linkinstances.
-
targetOptions
public TargetOptions targetOptions()
- Returns:
- the target options that will be used when creating new
Senderinstances.
-
copyInto
protected LinkOptions<T> copyInto(LinkOptions<T> other)
Copy all options from thisLinkOptionsinstance into the instance provided.- Parameters:
other- the target of this copy operation.- Returns:
- this options class for chaining.
-
self
protected abstract T self()
- Returns:
- the true derived type instance for use in this class.
-
-