public class DefaultHeaderFilterStrategy extends Object implements org.apache.camel.spi.HeaderFilterStrategy
extendedFilter(org.apache.camel.spi.HeaderFilterStrategy.Direction, String, Object, org.apache.camel.Exchange)
Filters are associated with directions (in or out). "In" direction is referred to propagating headers "to" Camel
message. The "out" direction is opposite which is referred to propagating headers from Camel message to a native
message like JMS and CXF message. You can see example of DefaultHeaderFilterStrategy are being extended and invoked
in camel-jms and camel-cxf components.| Modifier and Type | Field and Description |
|---|---|
static Pattern |
CAMEL_FILTER_PATTERN
Deprecated.
|
static String[] |
CAMEL_FILTER_STARTS_WITH
A filter pattern for keys starting with Camel, camel, or org.apache.camel.
|
| Constructor and Description |
|---|
DefaultHeaderFilterStrategy() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
applyFilterToCamelHeaders(String headerName,
Object headerValue,
org.apache.camel.Exchange exchange) |
boolean |
applyFilterToExternalHeaders(String headerName,
Object headerValue,
org.apache.camel.Exchange exchange) |
protected boolean |
extendedFilter(org.apache.camel.spi.HeaderFilterStrategy.Direction direction,
String key,
Object value,
org.apache.camel.Exchange exchange) |
Set<String> |
getInFilter()
Gets the "in" direction filter set.
|
String |
getInFilterPattern()
Gets the "in" direction filter regular expression
Pattern. |
Set<String> |
getOutFilter()
Gets the "out" direction filter set.
|
String |
getOutFilterPattern()
Gets the "out" direction filter regular expression
Pattern. |
boolean |
isAllowNullValues() |
boolean |
isCaseInsensitive()
Gets the caseInsensitive property which is a boolean to determine whether header names should be case insensitive
when checking it with the filter set.
|
boolean |
isFilterOnMatch() |
boolean |
isLowerCase()
Gets the isLowercase property which is a boolean to determine whether header names should be converted to lower
case before checking it with the filter Set.
|
void |
setAllowNullValues(boolean value)
Whether to allow null values.
|
void |
setCaseInsensitive(boolean caseInsensitive)
Sets the caseInsensitive property which is a boolean to determine whether header names should be case insensitive
when checking it with the filter set.
|
void |
setFilterOnMatch(boolean filterOnMatch)
Sets the filterOnMatch property which is a boolean to determine what to do when a pattern or filter set is
matched.
|
void |
setInFilter(Set<String> value)
Sets the "in" direction filter set.
|
void |
setInFilterPattern(Pattern pattern)
Sets the "in" direction filter regular expression
Pattern. |
void |
setInFilterPattern(String value)
Sets the "in" direction filter regular expression
Pattern. |
void |
setInFilterStartsWith(String... inFilterStartsWith)
Sets the "in" direction filter by starts with pattern.
|
void |
setLowerCase(boolean value)
Sets the isLowercase property which is a boolean to determine whether header names should be converted to lower
case before checking it with the filter Set.
|
void |
setOutFilter(Set<String> value)
Sets the "out" direction filter set.
|
void |
setOutFilterPattern(Pattern pattern)
Sets the "out" direction filter regular expression
Pattern. |
void |
setOutFilterPattern(String value)
Sets the "out" direction filter regular expression
Pattern. |
void |
setOutFilterStartsWith(String... outFilterStartsWith)
Sets the "out" direction filter by starts with pattern.
|
@Deprecated public static final Pattern CAMEL_FILTER_PATTERN
CAMEL_FILTER_STARTS_WITHpublic static final String[] CAMEL_FILTER_STARTS_WITH
public boolean applyFilterToCamelHeaders(String headerName, Object headerValue, org.apache.camel.Exchange exchange)
applyFilterToCamelHeaders in interface org.apache.camel.spi.HeaderFilterStrategypublic boolean applyFilterToExternalHeaders(String headerName, Object headerValue, org.apache.camel.Exchange exchange)
applyFilterToExternalHeaders in interface org.apache.camel.spi.HeaderFilterStrategypublic Set<String> getOutFilter()
public void setOutFilter(Set<String> value)
value - the filterpublic void setOutFilterStartsWith(String... outFilterStartsWith)
outFilterStartsWith - one or more key names to use for filtering using starts withpublic String getOutFilterPattern()
Pattern. The "out" direction is referred to copying
headers from Camel message to an external message. If the pattern matches a header, the header will be filtered
(skipped).public void setOutFilterPattern(String value)
Pattern. The "out" direction is referred to copying
headers from Camel message to an external message. If the pattern matches a header, the header will be filtered
(skipped).value - regular expression filter patternpublic void setOutFilterPattern(Pattern pattern)
Pattern. The "out" direction is referred to copying
headers from Camel message to an external message. If the pattern matches a header, the header will be filtered
(skipped).pattern - regular expression filter patternpublic Set<String> getInFilter()
public void setInFilter(Set<String> value)
value - the filterpublic void setInFilterStartsWith(String... inFilterStartsWith)
inFilterStartsWith - one or more key names to use for filtering using starts withpublic String getInFilterPattern()
Pattern. The "in" direction is referred to copying
headers from an external message to a Camel message. If the pattern matches a header, the header will be filtered
(skipped).public void setInFilterPattern(String value)
Pattern. The "in" direction is referred to copying
headers from an external message to a Camel message. If the pattern matches a header, the header will be filtered
(skipped).value - regular expression filter patternpublic void setInFilterPattern(Pattern pattern)
Pattern. The "in" direction is referred to copying
headers from an external message to a Camel message. If the pattern matches a header, the header will be filtered
(skipped).pattern - regular expression filter patternpublic boolean isLowerCase()
public void setLowerCase(boolean value)
public boolean isCaseInsensitive()
public void setCaseInsensitive(boolean caseInsensitive)
caseInsensitive - true if header names is case insensitive.public boolean isAllowNullValues()
public void setAllowNullValues(boolean value)
public boolean isFilterOnMatch()
public void setFilterOnMatch(boolean filterOnMatch)
filterOnMatch - true if a match filters (skips) the header.Apache Camel