Class AmqpCodec
java.lang.Object
org.apache.qpid.jms.provider.amqp.message.AmqpCodec
AMQP Codec class used to hide the details of encode / decode
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.qpid.proton.amqp.messaging.Sectiondecode(io.netty.buffer.ByteBuf encoded) Given an encoded AMQP Section, decode the value previously written there.static AmqpJmsMessageFacadedecodeMessage(AmqpConsumer consumer, org.apache.qpid.proton.codec.ReadableBuffer messageBytes) Create a new JmsMessage and underlying JmsMessageFacade that represents the proper message type for the incoming AMQP message.static io.netty.buffer.ByteBufencode(org.apache.qpid.proton.amqp.messaging.Section section) Given an AMQP Section encode it and return the buffer holding the encoded valuestatic io.netty.buffer.ByteBufencodeMessage(AmqpJmsMessageFacade message) Given a Message instance, encode the Message to the wire level representation of that Message.static org.apache.qpid.proton.codec.DecoderImplstatic org.apache.qpid.proton.codec.EncoderImpl
-
Constructor Details
-
AmqpCodec
public AmqpCodec()
-
-
Method Details
-
getEncoder
public static org.apache.qpid.proton.codec.EncoderImpl getEncoder()- Returns:
- a Encoder instance.
-
getDecoder
public static org.apache.qpid.proton.codec.DecoderImpl getDecoder()- Returns:
- a Decoder instance.
-
encode
public static io.netty.buffer.ByteBuf encode(org.apache.qpid.proton.amqp.messaging.Section section) Given an AMQP Section encode it and return the buffer holding the encoded value- Parameters:
section- the AMQP Section value to encode.- Returns:
- a buffer holding the encoded bytes of the given AMQP Section object.
-
decode
public static org.apache.qpid.proton.amqp.messaging.Section decode(io.netty.buffer.ByteBuf encoded) Given an encoded AMQP Section, decode the value previously written there.- Parameters:
encoded- the AMQP Section value to decode.- Returns:
- a Section object read from its encoded form.
-
encodeMessage
Given a Message instance, encode the Message to the wire level representation of that Message.- Parameters:
message- the Message that is to be encoded into the wire level representation.- Returns:
- a buffer containing the wire level representation of the input Message.
-
decodeMessage
public static AmqpJmsMessageFacade decodeMessage(AmqpConsumer consumer, org.apache.qpid.proton.codec.ReadableBuffer messageBytes) throws IOException Create a new JmsMessage and underlying JmsMessageFacade that represents the proper message type for the incoming AMQP message.- Parameters:
consumer- The AmqpConsumer instance that will be linked to the decoded message.messageBytes- The the raw bytes that compose the incoming message. (Read-Only)- Returns:
- a AmqpJmsMessageFacade instance decoded from the message bytes.
- Throws:
IOException- if an error occurs while creating the message objects.
-