Package org.apache.qpid.protonj2.client
Interface StreamDelivery
-
- All Superinterfaces:
Delivery
- All Known Implementing Classes:
ClientStreamDelivery
public interface StreamDelivery extends Delivery
A specializedDelivery
type that is returned from theStreamReceiver
which can be used to read incoming large messages that are streamed via multiple incoming AMQPTransfer
frames.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
aborted()
Check if theStreamDelivery
has been marked as aborted by the remote sender.StreamDelivery
accept()
Accepts and settles the delivery.boolean
completed()
Check if theStreamDelivery
has been marked as complete by the remote sender.StreamDelivery
disposition(DeliveryState state, boolean settle)
Updates the DeliveryState, and optionally settle the delivery as well.StreamReceiverMessage
message()
StreamDelivery
modified(boolean deliveryFailed, boolean undeliverableHere)
Modifies and settles the delivery.StreamReceiver
receiver()
StreamDelivery
reject(java.lang.String condition, java.lang.String description)
Rejects and settles the delivery, sending supplied error information along with the rejection.StreamDelivery
release()
Releases and settles the delivery.StreamDelivery
settle()
Settles the delivery locally.-
Methods inherited from interface org.apache.qpid.protonj2.client.Delivery
annotations, messageFormat, rawInputStream, remoteSettled, remoteState, settled, state
-
-
-
-
Method Detail
-
receiver
StreamReceiver receiver()
- Specified by:
receiver
in interfaceDelivery
- Returns:
- the
StreamReceiver
that originated thisStreamDelivery
.
-
message
StreamReceiverMessage message() throws ClientException
Decode theDelivery
payload and return anMessage
object.If the incoming message carried any delivery annotations they can be accessed via the
Delivery.annotations()
method. Re-sending the returned message will not also send the incoming delivery annotations, the sender must include them in theSender.send(Message, Map)
call if they are to be forwarded onto the next recipient.Calling this message claims the payload of the delivery for the returned
Message
and excludes use of theDelivery.rawInputStream()
method of theDelivery
object. Calling theDelivery.rawInputStream()
method after calling this method throwsClientIllegalStateException
.- Specified by:
message
in interfaceDelivery
- Returns:
- a
StreamReceiverMessage
instance that can be used to read the incoming message stream. - Throws:
ClientException
- if an error occurs while decoding the payload.
-
aborted
boolean aborted()
Check if theStreamDelivery
has been marked as aborted by the remote sender.- Returns:
- true if this context has been marked as aborted previously.
-
completed
boolean completed()
Check if theStreamDelivery
has been marked as complete by the remote sender.- Returns:
- true if this context has been marked as being the complete.
-
accept
StreamDelivery accept() throws ClientException
Accepts and settles the delivery.- Specified by:
accept
in interfaceDelivery
- Returns:
- the
StreamReceiver
that originated thisStreamDelivery
. - Throws:
ClientException
- if an error occurs while sending the disposition
-
release
StreamDelivery release() throws ClientException
Releases and settles the delivery.- Specified by:
release
in interfaceDelivery
- Returns:
- the
StreamReceiver
that originated thisStreamDelivery
. - Throws:
ClientException
- if an error occurs while sending the disposition
-
reject
StreamDelivery reject(java.lang.String condition, java.lang.String description) throws ClientException
Rejects and settles the delivery, sending supplied error information along with the rejection.- Specified by:
reject
in interfaceDelivery
- Parameters:
condition
- The error condition value to supply with the rejection.description
- The error description value to supply with the rejection.- Returns:
- the
StreamReceiver
that originated thisStreamDelivery
. - Throws:
ClientException
- if an error occurs while sending the disposition
-
modified
StreamDelivery modified(boolean deliveryFailed, boolean undeliverableHere) throws ClientException
Modifies and settles the delivery.- Specified by:
modified
in interfaceDelivery
- Parameters:
deliveryFailed
- Indicates if the modified delivery failed.undeliverableHere
- Indicates if the modified delivery should not be returned here again.- Returns:
- the
StreamReceiver
that originated thisStreamDelivery
. - Throws:
ClientException
- if an error occurs while sending the disposition
-
disposition
StreamDelivery disposition(DeliveryState state, boolean settle) throws ClientException
Updates the DeliveryState, and optionally settle the delivery as well.- Specified by:
disposition
in interfaceDelivery
- Parameters:
state
- the delivery state to applysettle
- whether toDelivery.settle()
the delivery at the same time- Returns:
- the
StreamReceiver
that originated thisStreamDelivery
. - Throws:
ClientException
- if an error occurs while sending the disposition
-
settle
StreamDelivery settle() throws ClientException
Settles the delivery locally.- Specified by:
settle
in interfaceDelivery
- Returns:
- the
StreamReceiver
that originated thisStreamDelivery
. - Throws:
ClientException
- if an error occurs while sending the disposition
-
-