Class RuleContainer
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.RuleContainer
- Direct Known Subclasses:
RewriteCustomizer
,VirtualHostRuleContainer
A container that groups Rule
s and is itself a Rule
.
The contained rules will be applied only if the container rule matches.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.rewrite.handler.Rule
Rule.Handler, Rule.HttpURIHandler
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds aRule
to the existing ones.void
clear()
Removes all the rules.void
dump
(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.getRules()
iterator()
matchAndApply
(Rule.Handler input) Processes the rules.void
setOriginalPathAttribute
(String originalPathAttribute) Sets a request attribute name that will be used to store the request original path.void
Set the list ofRule
..Methods inherited from class org.eclipse.jetty.rewrite.handler.Rule
isTerminating, setTerminating, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
ORIGINAL_QUERYSTRING_ATTRIBUTE_SUFFIX
- See Also:
-
-
Constructor Details
-
RuleContainer
public RuleContainer()
-
-
Method Details
-
getRules
- Returns:
- the list of
Rule
s
-
setRules
Set the list ofRule
..- Parameters:
rules
- the list ofRule
.
-
iterator
-
addRule
Adds a
Rule
to the existing ones.- Parameters:
rule
- the rule to add to the rules list
-
clear
public void clear()Removes all the rules.
-
getOriginalPathAttribute
- Returns:
- the request attribute name used to store the request original path
- See Also:
-
setOriginalPathAttribute
Sets a request attribute name that will be used to store the request original path.
A request attribute name that stores the request original query is derived from this attribute name by adding
ORIGINAL_QUERYSTRING_ATTRIBUTE_SUFFIX
, as in:String originalQueryAttribute = ruleContainer.getOriginalPathAttribute() + ORIGINAL_QUERYSTRING_ATTRIBUTE_SUFFIX;
- Parameters:
originalPathAttribute
- the request attribute name used to store the request original path
-
matchAndApply
Processes the rules.
- Specified by:
matchAndApply
in classRule
- Parameters:
input
- the inputRequest
andHandler
- Returns:
- a
Request
andHandler
, possibly wrapped by rules to implement the rule's logic, ornull
if no rule matched - Throws:
IOException
- if applying the rule fails
-
dump
Description copied from interface:Dumpable
Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.- Specified by:
dump
in interfaceDumpable
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-