public class DefaultHttpHeaderMapper extends Object implements HeaderMapper<HttpHeaders>, BeanFactoryAware, InitializingBean
HeaderMapper implementation for HTTP.| Modifier and Type | Field and Description | 
|---|---|
static String | 
CONTENT_MD5  | 
protected static java.time.format.DateTimeFormatter[] | 
DATE_FORMATS  | 
static String | 
HTTP_REQUEST_HEADER_NAME_PATTERN  | 
static String | 
HTTP_RESPONSE_HEADER_NAME_PATTERN  | 
protected Log | 
logger  | 
static String | 
REFRESH  | 
| Constructor and Description | 
|---|
DefaultHttpHeaderMapper()  | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
afterPropertiesSet()  | 
protected static boolean | 
containsElementIgnoreCase(String[] headerNames,
                         String name)  | 
protected String | 
convertToString(Object value)  | 
void | 
fromHeaders(MessageHeaders headers,
           HttpHeaders target)
Map from the integration MessageHeaders to an HttpHeaders instance. 
 | 
protected BeanFactory | 
getBeanFactory()  | 
protected static long | 
getFirstDate(String headerValue,
            String headerName)  | 
protected Object | 
getHttpHeader(HttpHeaders source,
             String name)  | 
static DefaultHttpHeaderMapper | 
inboundMapper()
Factory method for creating a basic inbound mapper instance. 
 | 
static DefaultHttpHeaderMapper | 
outboundMapper()
Factory method for creating a basic outbound mapper instance. 
 | 
void | 
setBeanFactory(BeanFactory beanFactory)  | 
void | 
setExcludedInboundStandardResponseHeaderNames(String... excludedInboundStandardResponseHeaderNames)
Provide header names from the list of standard headers that should be suppressed when
 mapping inbound endpoint response headers. 
 | 
void | 
setExcludedOutboundStandardRequestHeaderNames(String... excludedOutboundStandardRequestHeaderNames)
Provide header names from the list of standard headers that should be suppressed when
 mapping outbound endpoint request headers. 
 | 
void | 
setInboundHeaderNames(String... inboundHeaderNamesArg)
Provide the header names that should be mapped from an HTTP request (for inbound
 adapters) or HTTP response (for outbound adapters) to a Spring Integration
 Message's headers. 
 | 
void | 
setOutboundHeaderNames(String... outboundHeaderNames)
Provide the header names that should be mapped to an HTTP request (for outbound adapters)
 or HTTP response (for inbound adapters) from a Spring Integration Message's headers. 
 | 
protected static void | 
setupDefaultInboundMapper(DefaultHttpHeaderMapper mapper)
Subclasses can call this from a static inboundMapper() method to set up
 standard header mappings for an inbound mapper. 
 | 
protected static void | 
setupDefaultOutboundMapper(DefaultHttpHeaderMapper mapper)
Subclasses can call this from a static outboundMapper() method to set up
 standard header mappings for an outbound mapper. 
 | 
void | 
setUserDefinedHeaderPrefix(String userDefinedHeaderPrefix)
Sets the prefix to use with user-defined (non-standard) headers. 
 | 
protected boolean | 
shouldMapInboundHeader(String headerName)  | 
Map<String,Object> | 
toHeaders(HttpHeaders source)
Map from an HttpHeaders instance to integration MessageHeaders. 
 | 
protected final Log logger
public static final String CONTENT_MD5
public static final String REFRESH
public static final String HTTP_REQUEST_HEADER_NAME_PATTERN
public static final String HTTP_RESPONSE_HEADER_NAME_PATTERN
protected static final java.time.format.DateTimeFormatter[] DATE_FORMATS
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory in interface BeanFactoryAwareBeansExceptionprotected BeanFactory getBeanFactory()
public void setOutboundHeaderNames(String... outboundHeaderNames)
 Any non-standard headers will be prefixed with the value specified by
 setUserDefinedHeaderPrefix(String). The default is 'X-'.
outboundHeaderNames - The outbound header names.public void setInboundHeaderNames(String... inboundHeaderNamesArg)
This will match the header name directly or, for non-standard HTTP headers, it
 will match the header name prefixed with the value specified by
 setUserDefinedHeaderPrefix(String). The default for
 that is an empty String.
inboundHeaderNamesArg - The inbound header names.public void setExcludedOutboundStandardRequestHeaderNames(String... excludedOutboundStandardRequestHeaderNames)
excludedOutboundStandardRequestHeaderNames - the excludedStandardRequestHeaderNames to setpublic void setExcludedInboundStandardResponseHeaderNames(String... excludedInboundStandardResponseHeaderNames)
excludedInboundStandardResponseHeaderNames - the excludedStandardResponseHeaderNames to setpublic void setUserDefinedHeaderPrefix(String userDefinedHeaderPrefix)
userDefinedHeaderPrefix - The user defined header prefix.public void afterPropertiesSet()
afterPropertiesSet in interface InitializingBeanpublic void fromHeaders(MessageHeaders headers, HttpHeaders target)
fromHeaders in interface HeaderMapper<HttpHeaders>public Map<String,Object> toHeaders(HttpHeaders source)
toHeaders in interface HeaderMapper<HttpHeaders>protected Object getHttpHeader(HttpHeaders source, String name)
protected final boolean shouldMapInboundHeader(String headerName)
protected static boolean containsElementIgnoreCase(String[] headerNames, String name)
public static DefaultHttpHeaderMapper outboundMapper()
protected static void setupDefaultOutboundMapper(DefaultHttpHeaderMapper mapper)
mapper - the mapper.public static DefaultHttpHeaderMapper inboundMapper()
protected static void setupDefaultInboundMapper(DefaultHttpHeaderMapper mapper)
mapper - the mapper.