Class AbstractIntegrationMessageBuilder<T>
java.lang.Object
org.springframework.integration.support.AbstractIntegrationMessageBuilder<T>
- Direct Known Subclasses:
MessageBuilder
,MutableMessageBuilder
public abstract class AbstractIntegrationMessageBuilder<T> extends Object
- Since:
- 4.0
- Author:
- Gary Russell, Artem Bilan
-
Constructor Summary
Constructors Constructor Description AbstractIntegrationMessageBuilder()
-
Method Summary
-
Constructor Details
-
AbstractIntegrationMessageBuilder
public AbstractIntegrationMessageBuilder()
-
-
Method Details
-
setExpirationDate
-
setExpirationDate
-
setCorrelationId
-
pushSequenceDetails
public AbstractIntegrationMessageBuilder<T> pushSequenceDetails(Object correlationId, int sequenceNumber, int sequenceSize) -
popSequenceDetails
-
setReplyChannel
-
setReplyChannelName
-
setErrorChannel
-
setErrorChannelName
-
setSequenceNumber
-
setSequenceSize
-
setPriority
-
filterAndCopyHeadersIfAbsent
public AbstractIntegrationMessageBuilder<T> filterAndCopyHeadersIfAbsent(Map<String,?> headersToCopy, @Nullable String... headerPatternsToFilter)Remove headers from the provided map matching to the provided pattens and only after that copy the result into the target message headers.- Parameters:
headersToCopy
- a map of headers to copy.headerPatternsToFilter
- an arrays of header patterns to filter before copying.- Returns:
- the current
AbstractIntegrationMessageBuilder
. - Since:
- 5.1
- See Also:
copyHeadersIfAbsent(Map)
-
getSequenceDetails
-
getCorrelationId
-
getSequenceNumber
-
getSequenceSize
-
getPayload
-
getHeaders
-
getHeader
-
setHeader
public abstract AbstractIntegrationMessageBuilder<T> setHeader(String headerName, @Nullable Object headerValue)Set the value for the given header name. If the provided value isnull
, the header will be removed.- Parameters:
headerName
- The header name.headerValue
- The header value.- Returns:
- this.
-
setHeaderIfAbsent
public abstract AbstractIntegrationMessageBuilder<T> setHeaderIfAbsent(String headerName, Object headerValue)Set the value for the given header name only if the header name is not already associated with a value.- Parameters:
headerName
- The header name.headerValue
- The header value.- Returns:
- this.
-
removeHeaders
Removes all headers provided via array of 'headerPatterns'. As the name suggests the array may contain simple matching patterns for header names. Supported pattern styles are: "xxx*", "*xxx", "*xxx*" and "xxx*yyy".- Parameters:
headerPatterns
- The header patterns.- Returns:
- this.
-
removeHeader
Remove the value for the given header name.- Parameters:
headerName
- The header name.- Returns:
- this.
-
copyHeaders
public abstract AbstractIntegrationMessageBuilder<T> copyHeaders(@Nullable Map<String,?> headersToCopy)Copy the name-value pairs from the provided Map. This operation will overwrite any existing values. Use {copyHeadersIfAbsent(Map)
to avoid overwriting values. Note that the 'id' and 'timestamp' header values will never be overwritten.- Parameters:
headersToCopy
- The headers to copy.- Returns:
- this.
- See Also:
MessageHeaders.ID
,MessageHeaders.TIMESTAMP
-
copyHeadersIfAbsent
public abstract AbstractIntegrationMessageBuilder<T> copyHeadersIfAbsent(@Nullable Map<String,?> headersToCopy)Copy the name-value pairs from the provided Map. This operation will not overwrite any existing values.- Parameters:
headersToCopy
- The headers to copy.- Returns:
- this.
-
build
-