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:
java.lang.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 classClientStreamSender.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.ClientStreamSenderMessagebeginMessage()Creates and returns a newStreamSenderMessagethat can be used by the caller to perform streaming sends of large message payload data.org.apache.qpid.protonj2.client.impl.ClientStreamSenderMessagebeginMessage(java.util.Map<java.lang.String,java.lang.Object> deliveryAnnotations)Creates and returns a newStreamSenderMessagethat can be used by the caller to perform streaming sends of large message payload data.protected voidlinkSpecificCleanupHandler(ClientException failureCause)protected voidlinkSpecificLocalCloseHandler()protected voidlinkSpecificLocalOpenHandler()protected voidlinkSpecificRemoteCloseHandler()protected voidlinkSpecificRemoteOpenHandler()protected voidrecreateLinkForReconnect()protected StreamSenderself()StreamTrackersend(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.StreamTrackersend(Message<?> message, java.util.Map<java.lang.String,java.lang.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..StreamTrackertrySend(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.StreamTrackertrySend(Message<?> message, java.util.Map<java.lang.String,java.lang.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:StreamSenderSend 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.- Specified by:
sendin interfaceStreamSender- Parameters:
message- theMessageto send.- Returns:
- the
Trackerfor the message delivery - Throws:
ClientException- if an error occurs while initiating the send operation.
-
send
public StreamTracker send(Message<?> message, java.util.Map<java.lang.String,java.lang.Object> deliveryAnnotations) throws ClientException
Description copied from interface:StreamSenderSend 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..- Specified by:
sendin interfaceStreamSender- Parameters:
message- theMessageto send.deliveryAnnotations- the delivery annotations that should be included in the sentMessage.- Returns:
- the
StreamTrackerfor 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:StreamSenderSend 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.- Specified by:
trySendin interfaceStreamSender- Parameters:
message- theMessageto send if credit is available.- Returns:
- the
StreamTrackerfor 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, java.util.Map<java.lang.String,java.lang.Object> deliveryAnnotations) throws ClientException
Description copied from interface:StreamSenderSend 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.- Specified by:
trySendin interfaceStreamSender- Parameters:
message- theMessageto send if credit is available.deliveryAnnotations- the delivery annotations that should be included in the sentMessage.- Returns:
- the
StreamTrackerfor 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 ClientExceptionDescription copied from interface:StreamSenderCreates and returns a newStreamSenderMessagethat can be used by the caller to perform streaming sends of large message payload data.- Specified by:
beginMessagein interfaceStreamSender- Returns:
- a new
StreamSenderMessagethat 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(java.util.Map<java.lang.String,java.lang.Object> deliveryAnnotations) throws ClientExceptionDescription copied from interface:StreamSenderCreates and returns a newStreamSenderMessagethat can be used by the caller to perform streaming sends of large message payload data.- Specified by:
beginMessagein interfaceStreamSender- Parameters:
deliveryAnnotations- the delivery annotations that should be included in the sentStreamSenderMessage.- Returns:
- a new
StreamSenderMessagethat 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:
selfin classClientLinkType<StreamSender,Sender>
-
linkSpecificLocalOpenHandler
protected void linkSpecificLocalOpenHandler()
- Specified by:
linkSpecificLocalOpenHandlerin classClientLinkType<StreamSender,Sender>
-
recreateLinkForReconnect
protected void recreateLinkForReconnect()
- Specified by:
recreateLinkForReconnectin classClientLinkType<StreamSender,Sender>
-
linkSpecificCleanupHandler
protected void linkSpecificCleanupHandler(ClientException failureCause)
- Specified by:
linkSpecificCleanupHandlerin classClientLinkType<StreamSender,Sender>
-
linkSpecificLocalCloseHandler
protected void linkSpecificLocalCloseHandler()
- Specified by:
linkSpecificLocalCloseHandlerin classClientLinkType<StreamSender,Sender>
-
linkSpecificRemoteOpenHandler
protected void linkSpecificRemoteOpenHandler()
- Specified by:
linkSpecificRemoteOpenHandlerin classClientLinkType<StreamSender,Sender>
-
linkSpecificRemoteCloseHandler
protected void linkSpecificRemoteCloseHandler()
- Specified by:
linkSpecificRemoteCloseHandlerin classClientLinkType<StreamSender,Sender>
-
-