public class DefaultHttpHeaderMapper extends Object implements HeaderMapper<HttpHeaders>, BeanFactoryAware, InitializingBean
HeaderMapper
implementation for HTTP.Modifier and Type | Field and Description |
---|---|
static String |
COOKIE |
static String |
HTTP_REQUEST_HEADER_NAME_PATTERN |
static String |
HTTP_RESPONSE_HEADER_NAME_PATTERN |
static String |
SET_COOKIE |
Constructor and Description |
---|
DefaultHttpHeaderMapper() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
fromHeaders(MessageHeaders headers,
HttpHeaders target)
Map from the integration MessageHeaders to an HttpHeaders instance.
|
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 endopoint 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[] inboundHeaderNames)
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.
|
void |
setUserDefinedHeaderPrefix(String userDefinedHeaderPrefix)
Sets the prefix to use with user-defined (non-standard) headers.
|
Map<String,Object> |
toHeaders(HttpHeaders source)
Map from an HttpHeaders instance to integration MessageHeaders.
|
public static final String COOKIE
public static final String SET_COOKIE
public static final String HTTP_REQUEST_HEADER_NAME_PATTERN
public static final String HTTP_RESPONSE_HEADER_NAME_PATTERN
public void setBeanFactory(BeanFactory beanFactory) throws BeansException
setBeanFactory
in interface BeanFactoryAware
BeansException
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[] inboundHeaderNames)
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 is 'X-'.
inboundHeaderNames
- 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 fromHeaders(MessageHeaders headers, HttpHeaders target)
fromHeaders
in interface HeaderMapper<HttpHeaders>
public Map<String,Object> toHeaders(HttpHeaders source)
toHeaders
in interface HeaderMapper<HttpHeaders>
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public static DefaultHttpHeaderMapper outboundMapper()
public static DefaultHttpHeaderMapper inboundMapper()