Class ClientMessageSupport
- java.lang.Object
-
- org.apache.qpid.protonj2.client.impl.ClientMessageSupport
-
public abstract class ClientMessageSupport extends java.lang.Object
Support methods dealing with Message types and encode or decode operations.
-
-
Constructor Summary
Constructors Constructor Description ClientMessageSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <E> AdvancedMessage<E>
convertMessage(Message<E> message)
Converts aMessage
instance into aClientMessage
instance either by cast or by construction of a new instance with a copy of the values carried in the given message.static <E> Section<E>
createSectionFromValue(E body)
static Message<?>
decodeMessage(ProtonBuffer buffer, java.util.function.Consumer<DeliveryAnnotations> daConsumer)
static Message<?>
decodeMessage(Decoder decoder, ProtonBuffer buffer, java.util.function.Consumer<DeliveryAnnotations> daConsumer)
static Message<?>
decodeMessage(Decoder decoder, DecoderState decoderState, ProtonBuffer buffer, java.util.function.Consumer<DeliveryAnnotations> daConsumer)
static ProtonBuffer
encodeMessage(AdvancedMessage<?> message, java.util.Map<java.lang.String,java.lang.Object> deliveryAnnotations)
static ProtonBuffer
encodeMessage(Encoder encoder, ProtonBufferAllocator allocator, AdvancedMessage<?> message, java.util.Map<java.lang.String,java.lang.Object> deliveryAnnotations)
static ProtonBuffer
encodeMessage(Encoder encoder, EncoderState encoderState, ProtonBufferAllocator allocator, AdvancedMessage<?> message, java.util.Map<java.lang.String,java.lang.Object> deliveryAnnotations)
static ProtonBuffer
encodeSection(Section<?> section, ProtonBuffer buffer)
-
-
-
Method Detail
-
convertMessage
public static <E> AdvancedMessage<E> convertMessage(Message<E> message) throws ClientException
Converts aMessage
instance into aClientMessage
instance either by cast or by construction of a new instance with a copy of the values carried in the given message.- Type Parameters:
E
- the body type of the given message.- Parameters:
message
- TheMessage
type to attempt to convert to aClientMessage
instance.- Returns:
- a
ClientMessage
that represents the givenMessage
instance. - Throws:
ClientException
- if an unrecoverable error occurs during message conversion.
-
encodeSection
public static ProtonBuffer encodeSection(Section<?> section, ProtonBuffer buffer)
-
encodeMessage
public static ProtonBuffer encodeMessage(AdvancedMessage<?> message, java.util.Map<java.lang.String,java.lang.Object> deliveryAnnotations) throws ClientException
- Throws:
ClientException
-
encodeMessage
public static ProtonBuffer encodeMessage(Encoder encoder, ProtonBufferAllocator allocator, AdvancedMessage<?> message, java.util.Map<java.lang.String,java.lang.Object> deliveryAnnotations) throws ClientException
- Throws:
ClientException
-
encodeMessage
public static ProtonBuffer encodeMessage(Encoder encoder, EncoderState encoderState, ProtonBufferAllocator allocator, AdvancedMessage<?> message, java.util.Map<java.lang.String,java.lang.Object> deliveryAnnotations) throws ClientException
- Throws:
ClientException
-
decodeMessage
public static Message<?> decodeMessage(ProtonBuffer buffer, java.util.function.Consumer<DeliveryAnnotations> daConsumer) throws ClientException
- Throws:
ClientException
-
decodeMessage
public static Message<?> decodeMessage(Decoder decoder, ProtonBuffer buffer, java.util.function.Consumer<DeliveryAnnotations> daConsumer) throws ClientException
- Throws:
ClientException
-
decodeMessage
public static Message<?> decodeMessage(Decoder decoder, DecoderState decoderState, ProtonBuffer buffer, java.util.function.Consumer<DeliveryAnnotations> daConsumer) throws ClientException
- Throws:
ClientException
-
createSectionFromValue
public static <E> Section<E> createSectionFromValue(E body)
-
-