private ApplicationProperties lazyDecodeApplicationProperties() { if (applicationProperties == null && applicationPropertiesPosition != VALUE_NOT_PRESENT) { applicationProperties = scanForMessageSection(applicationPropertiesPosition, ApplicationProperties.class); } return applicationProperties; }
/** * Retrieves the AMQP Footer encoded in the data of this message by decoding a * fresh copy from the encoded message data. Changes to the returned value are not * reflected in the value encoded in the original message. * * @return the Footer that was encoded into this AMQP Message. */ public Footer getFooter() { ensureMessageDataScanned(); ensureDataIsValid(); return scanForMessageSection(Math.max(0, remainingBodyPosition), Footer.class); }
/** * Retrieves the AMQP Section that composes the body of this message by decoding a * fresh copy from the encoded message data. Changes to the returned value are not * reflected in the value encoded in the original message. * * @return the Section that makes up the body of this message. */ public Section getBody() { ensureMessageDataScanned(); ensureDataIsValid(); // We only handle Sections of AmqpSequence, AmqpValue and Data types so we filter on those. // There could also be a Footer and no body so this will prevent a faulty return type in case // of no body or message type we don't handle. return scanForMessageSection(Math.max(0, remainingBodyPosition), AmqpSequence.class, AmqpValue.class, Data.class); }
/** * Returns a copy of the message Header if one is present, changes to the returned * Header instance do not affect the original Message. * * @return a copy of the Message Header if one exists or null if none present. */ public Header getHeader() { ensureMessageDataScanned(); ensureDataIsValid(); return scanForMessageSection(headerPosition, Header.class); }
/** * Returns a copy of the MessageAnnotations in the message if present or null. Changes to the * returned DeliveryAnnotations instance do not affect the original Message. * * @return a copy of the {@link DeliveryAnnotations} present in the message or null if non present. */ public DeliveryAnnotations getDeliveryAnnotations() { ensureMessageDataScanned(); ensureDataIsValid(); return scanForMessageSection(deliveryAnnotationsPosition, DeliveryAnnotations.class); }
/** * Returns a copy of the message Properties if one is present, changes to the returned * Properties instance do not affect the original Message. * * @return a copy of the Message Properties if one exists or null if none present. */ public Properties getProperties() { ensureMessageDataScanned(); ensureDataIsValid(); return scanForMessageSection(propertiesPosition, Properties.class); }
/** * Returns a copy of the DeliveryAnnotations in the message if present or null. Changes to the * returned MessageAnnotations instance do not affect the original Message. * * @return a copy of the {@link MessageAnnotations} present in the message or null if non present. */ public MessageAnnotations getMessageAnnotations() { ensureMessageDataScanned(); ensureDataIsValid(); return scanForMessageSection(messageAnnotationsPosition, MessageAnnotations.class); }
/** * Returns a copy of the {@link ApplicationProperties} present in the message if present or null. * Changes to the returned MessageAnnotations instance do not affect the original Message. * * @return a copy of the {@link ApplicationProperties} present in the message or null if non present. */ public ApplicationProperties getApplicationProperties() { ensureMessageDataScanned(); ensureDataIsValid(); return scanForMessageSection(applicationPropertiesPosition, ApplicationProperties.class); }