Class ClientStreamDelivery
- java.lang.Object
-
- org.apache.qpid.protonj2.client.impl.ClientDeliverable<ClientStreamDelivery,ClientStreamReceiver>
-
- org.apache.qpid.protonj2.client.impl.ClientStreamDelivery
-
- All Implemented Interfaces:
StreamDelivery
public final class ClientStreamDelivery extends ClientDeliverable<ClientStreamDelivery,ClientStreamReceiver> implements StreamDelivery
AStreamDelivery
implementation that provides the mechanics of reading message types from an incoming split framed transfer.
-
-
Field Summary
-
Fields inherited from class org.apache.qpid.protonj2.client.impl.ClientDeliverable
delivery
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
aborted()
Check if theStreamDelivery
has been marked as aborted by the remote sender.Map<String,Object>
annotations()
Decodes theStreamDelivery
payload and returns aMap
containing a copy of any associatedDeliveryAnnotations
that were transmitted with theMessage
payload of thisStreamDelivery
.boolean
completed()
Check if theStreamDelivery
has been marked as complete by the remote sender.ClientStreamReceiverMessage
message()
Decode theStreamDelivery
payload and return anMessage
object.InputStream
rawInputStream()
Create and return anInputStream
that reads the raw payload bytes of the givenStreamDelivery
.ClientStreamReceiver
receiver()
protected ClientStreamDelivery
self()
-
Methods inherited from class org.apache.qpid.protonj2.client.impl.ClientDeliverable
accept, disposition, messageFormat, modified, reject, release, remoteSettled, remoteState, settle, settled, state
-
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.StreamDelivery
accept, disposition, messageFormat, modified, reject, release, remoteSettled, remoteState, settle, settled, state
-
-
-
-
Method Detail
-
self
protected ClientStreamDelivery self()
- Specified by:
self
in classClientDeliverable<ClientStreamDelivery,ClientStreamReceiver>
-
receiver
public ClientStreamReceiver receiver()
- Specified by:
receiver
in interfaceStreamDelivery
- Returns:
- the
StreamReceiver
that originated thisStreamDelivery
.
-
aborted
public boolean aborted()
Description copied from interface:StreamDelivery
Check if theStreamDelivery
has been marked as aborted by the remote sender.- Specified by:
aborted
in interfaceStreamDelivery
- Returns:
- true if this context has been marked as aborted previously.
-
completed
public boolean completed()
Description copied from interface:StreamDelivery
Check if theStreamDelivery
has been marked as complete by the remote sender.- Specified by:
completed
in interfaceStreamDelivery
- Returns:
- true if this context has been marked as being the complete.
-
message
public ClientStreamReceiverMessage message() throws ClientException
Description copied from interface:StreamDelivery
Decode theStreamDelivery
payload and return anMessage
object.If the incoming message carried any delivery annotations they can be accessed via the
StreamDelivery.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 theStreamDelivery.rawInputStream()
method of theStreamDelivery
object. Calling theStreamDelivery.rawInputStream()
method after calling this method throwsClientIllegalStateException
.- Specified by:
message
in interfaceStreamDelivery
- Returns:
- a
Message
instance that wraps the decoded payload. - Throws:
ClientException
- if an error occurs while decoding the payload.
-
annotations
public Map<String,Object> annotations() throws ClientException
Description copied from interface:StreamDelivery
Decodes theStreamDelivery
payload and returns aMap
containing a copy of any associatedDeliveryAnnotations
that were transmitted with theMessage
payload of thisStreamDelivery
.Calling this message claims the payload of the delivery for the returned
Map
and the decodedMessage
that can be accessed via theStreamDelivery.message()
method and excludes use of theStreamDelivery.rawInputStream()
method of theStreamDelivery
object. Calling theStreamDelivery.rawInputStream()
method after calling this method throwsClientIllegalStateException
.- Specified by:
annotations
in interfaceStreamDelivery
- Returns:
- copy of the delivery annotations that were transmitted with the
Message
payload. - Throws:
ClientException
- if an error occurs while decoding the payload.
-
rawInputStream
public InputStream rawInputStream() throws ClientException
Description copied from interface:StreamDelivery
Create and return anInputStream
that reads the raw payload bytes of the givenStreamDelivery
.Calling this method claims the payload of the delivery for the returned
InputStream
and excludes use of theStreamDelivery.message()
andStreamDelivery.annotations()
methods of theStreamDelivery
object. Closing the returned input stream discards any unread bytes from the delivery payload. Calling theStreamDelivery.message()
orStreamDelivery.annotations()
methods after calling this method throwsClientIllegalStateException
.- Specified by:
rawInputStream
in interfaceStreamDelivery
- Returns:
- an
InputStream
instance that can be used to read the raw delivery payload. - Throws:
ClientException
- if an error occurs while decoding the payload.
-
-