Spring Integration

org.springframework.integration.amqp.support
Class DefaultAmqpHeaderMapper

java.lang.Object
  extended by org.springframework.integration.mapping.AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
      extended by org.springframework.integration.amqp.support.DefaultAmqpHeaderMapper
All Implemented Interfaces:
AmqpHeaderMapper, RequestReplyHeaderMapper<org.springframework.amqp.core.MessageProperties>

public class DefaultAmqpHeaderMapper
extends AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>
implements AmqpHeaderMapper

Default implementation of AmqpHeaderMapper.

By default this implementation will only copy AMQP properties (e.g. contentType) to and from Spring Integration MessageHeaders. Any user-defined headers within the AMQP MessageProperties will NOT be copied to or from an AMQP Message unless explicitly identified via 'requestHeaderNames' and/or 'replyHeaderNames' (see AbstractHeaderMapper.setRequestHeaderNames(String[]) and AbstractHeaderMapper.setReplyHeaderNames(String[])} as well as 'mapped-request-headers' and 'mapped-reply-headers' attributes of the AMQP adapters). If you need to copy all user-defined headers simply use wild-card character '*'.

Constants for the AMQP header keys are defined in AmqpHeaders.

Since:
2.1
Author:
Mark Fisher, Oleg Zhurakousky

Field Summary
 
Fields inherited from class org.springframework.integration.mapping.AbstractHeaderMapper
logger, STANDARD_REPLY_HEADER_NAME_PATTERN, STANDARD_REQUEST_HEADER_NAME_PATTERN
 
Constructor Summary
DefaultAmqpHeaderMapper()
           
 
Method Summary
protected  java.util.Map<java.lang.String,java.lang.Object> extractStandardHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties)
          Extract "standard" headers from an AMQP MessageProperties instance.
protected  java.util.Map<java.lang.String,java.lang.Object> extractUserDefinedHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties)
          Extract user-defined headers from an AMQP MessageProperties instance.
protected  java.lang.String getStandardHeaderPrefix()
          Returns the list of standard REPLY headers.
protected  java.util.List<java.lang.String> getStandardReplyHeaderNames()
          Returns the list of standard REQUEST headers.
protected  java.util.List<java.lang.String> getStandardRequestHeaderNames()
          Returns the PREFIX used by standard headers (if any)
protected  void populateStandardHeaders(java.util.Map<java.lang.String,java.lang.Object> headers, org.springframework.amqp.core.MessageProperties amqpMessageProperties)
          Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.
protected  void populateUserDefinedHeader(java.lang.String headerName, java.lang.Object headerValue, org.springframework.amqp.core.MessageProperties amqpMessageProperties)
           
 
Methods inherited from class org.springframework.integration.mapping.AbstractHeaderMapper
fromHeadersToReply, fromHeadersToRequest, getHeaderIfAvailable, setReplyHeaderNames, setRequestHeaderNames, setUserDefinedHeaderPrefix, toHeadersFromReply, toHeadersFromRequest
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.integration.mapping.RequestReplyHeaderMapper
fromHeadersToReply, fromHeadersToRequest, toHeadersFromReply, toHeadersFromRequest
 

Constructor Detail

DefaultAmqpHeaderMapper

public DefaultAmqpHeaderMapper()
Method Detail

extractStandardHeaders

protected java.util.Map<java.lang.String,java.lang.Object> extractStandardHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties)
Extract "standard" headers from an AMQP MessageProperties instance.

Specified by:
extractStandardHeaders in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>

extractUserDefinedHeaders

protected java.util.Map<java.lang.String,java.lang.Object> extractUserDefinedHeaders(org.springframework.amqp.core.MessageProperties amqpMessageProperties)
Extract user-defined headers from an AMQP MessageProperties instance.

Specified by:
extractUserDefinedHeaders in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>

populateStandardHeaders

protected void populateStandardHeaders(java.util.Map<java.lang.String,java.lang.Object> headers,
                                       org.springframework.amqp.core.MessageProperties amqpMessageProperties)
Maps headers from a Spring Integration MessageHeaders instance to the MessageProperties of an AMQP Message.

Specified by:
populateStandardHeaders in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>

populateUserDefinedHeader

protected void populateUserDefinedHeader(java.lang.String headerName,
                                         java.lang.Object headerValue,
                                         org.springframework.amqp.core.MessageProperties amqpMessageProperties)
Specified by:
populateUserDefinedHeader in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>

getStandardRequestHeaderNames

protected java.util.List<java.lang.String> getStandardRequestHeaderNames()
Description copied from class: AbstractHeaderMapper
Returns the PREFIX used by standard headers (if any)

Overrides:
getStandardRequestHeaderNames in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>

getStandardReplyHeaderNames

protected java.util.List<java.lang.String> getStandardReplyHeaderNames()
Description copied from class: AbstractHeaderMapper
Returns the list of standard REQUEST headers. Implementation provided by a subclass

Overrides:
getStandardReplyHeaderNames in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>

getStandardHeaderPrefix

protected java.lang.String getStandardHeaderPrefix()
Description copied from class: AbstractHeaderMapper
Returns the list of standard REPLY headers. Implementation provided by a subclass

Specified by:
getStandardHeaderPrefix in class AbstractHeaderMapper<org.springframework.amqp.core.MessageProperties>

Spring Integration