Class ClientStreamSession
- java.lang.Object
-
- org.apache.qpid.protonj2.client.impl.ClientSession
-
- org.apache.qpid.protonj2.client.impl.ClientStreamSession
-
- All Implemented Interfaces:
java.lang.AutoCloseable,Session
public final class ClientStreamSession extends ClientSession
A specializedClientSessionthat is the parent of aClientStreamSenderorClientStreamReceiverand cannot create any further resources as the lifetime of the session is tied to the childStreamSenderorStreamReceiver.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SenderopenAnonymousSender()Creates a sender that is established to the 'anonymous relay' and as such each message that is sent using this sender must specify an address in its destination address field.SenderopenAnonymousSender(SenderOptions senderOptions)Creates a sender that is established to the 'anonymous relay' and as such each message that is sent using this sender must specify an address in its destination address field.ReceiveropenDurableReceiver(java.lang.String address, java.lang.String subscriptionName)Creates a receiver used to consume messages from the given node address and configure it such that the remote create a durable node.ReceiveropenDurableReceiver(java.lang.String address, java.lang.String subscriptionName, ReceiverOptions receiverOptions)Creates a receiver used to consume messages from the given node address and configure it such that the remote create a durable node.ReceiveropenDynamicReceiver()Creates a dynamic receiver used to consume messages from the given node address.ReceiveropenDynamicReceiver(java.util.Map<java.lang.String,java.lang.Object> dynamicNodeProperties)Creates a dynamic receiver used to consume messages from the given node address.ReceiveropenDynamicReceiver(java.util.Map<java.lang.String,java.lang.Object> dynamicNodeProperties, ReceiverOptions receiverOptions)Creates a dynamic receiver used to consume messages from the given node address.ReceiveropenDynamicReceiver(ReceiverOptions receiverOptions)Creates a dynamic receiver used to consume messages from the given node address.ReceiveropenReceiver(java.lang.String address)Creates a receiver used to consume messages from the given node address.ReceiveropenReceiver(java.lang.String address, ReceiverOptions receiverOptions)Creates a receiver used to consume messages from the given node address.SenderopenSender(java.lang.String address)Creates a sender used to send messages to the given node address.SenderopenSender(java.lang.String address, SenderOptions senderOptions)Creates a sender used to send messages to the given node address.-
Methods inherited from class org.apache.qpid.protonj2.client.impl.ClientSession
beginTransaction, checkClosedOrFailed, client, close, close, closeAsync, closeAsync, commitTransaction, connection, desiredCapabilities, offeredCapabilities, openFuture, properties, rollbackTransaction
-
-
-
-
Method Detail
-
openReceiver
public Receiver openReceiver(java.lang.String address) throws ClientException
Description copied from interface:SessionCreates a receiver used to consume messages from the given node address.- Specified by:
openReceiverin interfaceSession- Overrides:
openReceiverin classClientSession- Parameters:
address- The source address to attach the consumer to.- Returns:
- the newly created
Receiver - Throws:
ClientException- if an internal error occurs.
-
openReceiver
public Receiver openReceiver(java.lang.String address, ReceiverOptions receiverOptions) throws ClientException
Description copied from interface:SessionCreates a receiver used to consume messages from the given node address.- Specified by:
openReceiverin interfaceSession- Overrides:
openReceiverin classClientSession- Parameters:
address- The source address to attach the consumer to.receiverOptions- The options for this receiver.- Returns:
- the newly created
Receiver - Throws:
ClientException- if an internal error occurs.
-
openDurableReceiver
public Receiver openDurableReceiver(java.lang.String address, java.lang.String subscriptionName) throws ClientException
Description copied from interface:SessionCreates a receiver used to consume messages from the given node address and configure it such that the remote create a durable node.- Specified by:
openDurableReceiverin interfaceSession- Overrides:
openDurableReceiverin classClientSession- Parameters:
address- The source address to attach the consumer to.subscriptionName- The name to give the subscription (link name).- Returns:
- the newly created
Receiver - Throws:
ClientException- if an internal error occurs.
-
openDurableReceiver
public Receiver openDurableReceiver(java.lang.String address, java.lang.String subscriptionName, ReceiverOptions receiverOptions) throws ClientException
Description copied from interface:SessionCreates a receiver used to consume messages from the given node address and configure it such that the remote create a durable node.- Specified by:
openDurableReceiverin interfaceSession- Overrides:
openDurableReceiverin classClientSession- Parameters:
address- The source address to attach the consumer to.subscriptionName- The name to give the subscription (link name).receiverOptions- The options for this receiver.- Returns:
- the newly created
Receiver - Throws:
ClientException- if an internal error occurs.
-
openDynamicReceiver
public Receiver openDynamicReceiver() throws ClientException
Description copied from interface:SessionCreates a dynamic receiver used to consume messages from the given node address.- Specified by:
openDynamicReceiverin interfaceSession- Overrides:
openDynamicReceiverin classClientSession- Returns:
- the newly created
Receiver - Throws:
ClientException- if an internal error occurs.
-
openDynamicReceiver
public Receiver openDynamicReceiver(java.util.Map<java.lang.String,java.lang.Object> dynamicNodeProperties) throws ClientException
Description copied from interface:SessionCreates a dynamic receiver used to consume messages from the given node address.- Specified by:
openDynamicReceiverin interfaceSession- Overrides:
openDynamicReceiverin classClientSession- Parameters:
dynamicNodeProperties- The dynamic node properties to be applied to the node created by the remote.- Returns:
- the newly created
Receiver - Throws:
ClientException- if an internal error occurs.
-
openDynamicReceiver
public Receiver openDynamicReceiver(ReceiverOptions receiverOptions) throws ClientException
Description copied from interface:SessionCreates a dynamic receiver used to consume messages from the given node address.- Specified by:
openDynamicReceiverin interfaceSession- Overrides:
openDynamicReceiverin classClientSession- Parameters:
receiverOptions- The options for this receiver.- Returns:
- the newly created
Receiver - Throws:
ClientException- if an internal error occurs.
-
openDynamicReceiver
public Receiver openDynamicReceiver(java.util.Map<java.lang.String,java.lang.Object> dynamicNodeProperties, ReceiverOptions receiverOptions) throws ClientException
Description copied from interface:SessionCreates a dynamic receiver used to consume messages from the given node address.- Specified by:
openDynamicReceiverin interfaceSession- Overrides:
openDynamicReceiverin classClientSession- Parameters:
dynamicNodeProperties- The dynamic node properties to be applied to the node created by the remote.receiverOptions- The options for this receiver.- Returns:
- the newly created
Receiver - Throws:
ClientException- if an internal error occurs.
-
openSender
public Sender openSender(java.lang.String address) throws ClientException
Description copied from interface:SessionCreates a sender used to send messages to the given node address. If no address (i.e null) is specified then a sender will be established to the 'anonymous relay' and each message must specify its destination address.- Specified by:
openSenderin interfaceSession- Overrides:
openSenderin classClientSession- Parameters:
address- The target address to attach to, or null to attach to the anonymous relay.- Returns:
- the newly created
Sender. - Throws:
ClientException- if an internal error occurs.
-
openSender
public Sender openSender(java.lang.String address, SenderOptions senderOptions) throws ClientException
Description copied from interface:SessionCreates a sender used to send messages to the given node address. If no address (i.e null) is specified then a sender will be established to the 'anonymous relay' and each message must specify its destination address.- Specified by:
openSenderin interfaceSession- Overrides:
openSenderin classClientSession- Parameters:
address- The target address to attach to, or null to attach to the anonymous relay.senderOptions- The options for this sender.- Returns:
- the newly created
Sender. - Throws:
ClientException- if an internal error occurs.
-
openAnonymousSender
public Sender openAnonymousSender() throws ClientException
Description copied from interface:SessionCreates a sender that is established to the 'anonymous relay' and as such each message that is sent using this sender must specify an address in its destination address field.- Specified by:
openAnonymousSenderin interfaceSession- Overrides:
openAnonymousSenderin classClientSession- Returns:
- the newly created
Sender. - Throws:
ClientException- if an internal error occurs.ClientUnsupportedOperationException- if the remote did not signal support for anonymous relays.
-
openAnonymousSender
public Sender openAnonymousSender(SenderOptions senderOptions) throws ClientException
Description copied from interface:SessionCreates a sender that is established to the 'anonymous relay' and as such each message that is sent using this sender must specify an address in its destination address field.- Specified by:
openAnonymousSenderin interfaceSession- Overrides:
openAnonymousSenderin classClientSession- Parameters:
senderOptions- The options for this sender.- Returns:
- the newly created
Sender. - Throws:
ClientException- if an internal error occurs.ClientUnsupportedOperationException- if the remote did not signal support for anonymous relays.
-
-