Class ClientStreamSender
- java.lang.Object
-
- org.apache.qpid.protonj2.client.impl.ClientLinkType<LinkType,Sender>
-
- org.apache.qpid.protonj2.client.impl.ClientSenderLinkType<StreamSender>
-
- org.apache.qpid.protonj2.client.impl.ClientStreamSender
-
- All Implemented Interfaces:
AutoCloseable
,Link<StreamSender>
,StreamSender
public final class ClientStreamSender extends ClientSenderLinkType<StreamSender> implements StreamSender
Client implementation of aStreamSender
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClientStreamSender.ClientOutgoingEnvelope
-
Field Summary
-
Fields inherited from class org.apache.qpid.protonj2.client.impl.ClientSenderLinkType
protonSender
-
Fields inherited from class org.apache.qpid.protonj2.client.impl.ClientLinkType
closed, CLOSED_UPDATER, closeFuture, executor, failureCause, linkId, linkRemotelyClosedHandler, openFuture, remoteSource, remoteTarget, session
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.qpid.protonj2.client.impl.ClientStreamSenderMessage
beginMessage()
Creates and returns a newStreamSenderMessage
that can be used by the caller to perform streaming sends of large message payload data.org.apache.qpid.protonj2.client.impl.ClientStreamSenderMessage
beginMessage(Map<String,Object> deliveryAnnotations)
Creates and returns a newStreamSenderMessage
that can be used by the caller to perform streaming sends of large message payload data.protected void
linkSpecificCleanupHandler(ClientException failureCause)
protected void
linkSpecificLocalCloseHandler()
protected void
linkSpecificLocalOpenHandler()
protected void
linkSpecificRemoteCloseHandler()
protected void
linkSpecificRemoteOpenHandler()
protected void
recreateLinkForReconnect()
protected StreamSender
self()
StreamTracker
send(Message<?> message)
Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit or there is a streaming send ongoing.StreamTracker
send(Message<?> message, Map<String,Object> deliveryAnnotations)
Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit or there is a streaming send ongoing.StreamTracker
trySend(Message<?> message)
Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt or a streaming send is ongoing.StreamTracker
trySend(Message<?> message, Map<String,Object> deliveryAnnotations)
Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt.-
Methods inherited from class org.apache.qpid.protonj2.client.impl.ClientSenderLinkType
protonLink
-
Methods inherited from class org.apache.qpid.protonj2.client.impl.ClientLinkType
address, checkClosedOrFailed, client, close, close, closeAsync, closeAsync, connection, desiredCapabilities, detach, detach, detachAsync, detachAsync, handleEngineShutdown, handleLocalCloseOrDetach, handleLocalOpen, handleParentEndpointClosed, handleRemoteCloseOrDetach, handleRemoteOpen, immediateLinkShutdown, notClosedOrFailed, notClosedOrFailed, offeredCapabilities, openFuture, properties, session, source, target, waitForOpenToComplete
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.qpid.protonj2.client.Link
address, client, close, close, closeAsync, closeAsync, connection, desiredCapabilities, detach, detach, detachAsync, detachAsync, offeredCapabilities, openFuture, properties, session, source, target
-
-
-
-
Method Detail
-
send
public StreamTracker send(Message<?> message) throws ClientException
Description copied from interface:StreamSender
Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit or there is a streaming send ongoing.Upon successfully sending the message the methods returns a
Tracker
that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.- Specified by:
send
in interfaceStreamSender
- Parameters:
message
- theMessage
to send.- Returns:
- the
Tracker
for the message delivery - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
send
public StreamTracker send(Message<?> message, Map<String,Object> deliveryAnnotations) throws ClientException
Description copied from interface:StreamSender
Send the given message immediately if there is credit available or blocks if the link has not yet been granted credit or there is a streaming send ongoing. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.Upon successfully sending the message the methods returns a
Tracker
that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.- Specified by:
send
in interfaceStreamSender
- Parameters:
message
- theMessage
to send.deliveryAnnotations
- the delivery annotations that should be included in the sentMessage
.- Returns:
- the
StreamTracker
for the message delivery - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
trySend
public StreamTracker trySend(Message<?> message) throws ClientException
Description copied from interface:StreamSender
Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt or a streaming send is ongoing.Upon successfully sending the message the methods returns a
Tracker
that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.- Specified by:
trySend
in interfaceStreamSender
- Parameters:
message
- theMessage
to send if credit is available.- Returns:
- the
StreamTracker
for the message delivery or null if no credit for sending. - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
trySend
public StreamTracker trySend(Message<?> message, Map<String,Object> deliveryAnnotations) throws ClientException
Description copied from interface:StreamSender
Send the given message if credit is available or returns null if no credit has been granted to the link at the time of the send attempt. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.Upon successfully sending the message the methods returns a
Tracker
that can be used to await settlement of the message from the remote. If the sender has been configured to send the message pre-settled then the resulting Tracker will immediately report the message as remotely settlement and accepted.- Specified by:
trySend
in interfaceStreamSender
- Parameters:
message
- theMessage
to send if credit is available.deliveryAnnotations
- the delivery annotations that should be included in the sentMessage
.- Returns:
- the
StreamTracker
for the message delivery or null if no credit for sending. - Throws:
ClientException
- if an error occurs while initiating the send operation.
-
beginMessage
public org.apache.qpid.protonj2.client.impl.ClientStreamSenderMessage beginMessage() throws ClientException
Description copied from interface:StreamSender
Creates and returns a newStreamSenderMessage
that can be used by the caller to perform streaming sends of large message payload data.- Specified by:
beginMessage
in interfaceStreamSender
- Returns:
- a new
StreamSenderMessage
that can be used to stream message data to the remote. - Throws:
ClientException
- if an error occurs while initiating a new streaming send message.
-
beginMessage
public org.apache.qpid.protonj2.client.impl.ClientStreamSenderMessage beginMessage(Map<String,Object> deliveryAnnotations) throws ClientException
Description copied from interface:StreamSender
Creates and returns a newStreamSenderMessage
that can be used by the caller to perform streaming sends of large message payload data. The provided delivery annotations are encoded along with the message, the annotations can be passed repeatedly to send calls if sending the same delivery annotations with each message.- Specified by:
beginMessage
in interfaceStreamSender
- Parameters:
deliveryAnnotations
- the delivery annotations that should be included in the sentStreamSenderMessage
.- Returns:
- a new
StreamSenderMessage
that can be used to stream message data to the remote. - Throws:
ClientException
- if an error occurs while initiating a new streaming send message.
-
self
protected StreamSender self()
- Specified by:
self
in classClientLinkType<StreamSender,Sender>
-
linkSpecificLocalOpenHandler
protected void linkSpecificLocalOpenHandler()
- Specified by:
linkSpecificLocalOpenHandler
in classClientLinkType<StreamSender,Sender>
-
recreateLinkForReconnect
protected void recreateLinkForReconnect()
- Specified by:
recreateLinkForReconnect
in classClientLinkType<StreamSender,Sender>
-
linkSpecificCleanupHandler
protected void linkSpecificCleanupHandler(ClientException failureCause)
- Specified by:
linkSpecificCleanupHandler
in classClientLinkType<StreamSender,Sender>
-
linkSpecificLocalCloseHandler
protected void linkSpecificLocalCloseHandler()
- Specified by:
linkSpecificLocalCloseHandler
in classClientLinkType<StreamSender,Sender>
-
linkSpecificRemoteOpenHandler
protected void linkSpecificRemoteOpenHandler()
- Specified by:
linkSpecificRemoteOpenHandler
in classClientLinkType<StreamSender,Sender>
-
linkSpecificRemoteCloseHandler
protected void linkSpecificRemoteCloseHandler()
- Specified by:
linkSpecificRemoteCloseHandler
in classClientLinkType<StreamSender,Sender>
-
-