java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.RuleContainer
- Direct Known Subclasses:
RewriteCustomizer,VirtualHostRuleContainer
public class RuleContainer
extends Rule
implements Iterable<Rule>, org.eclipse.jetty.util.component.Dumpable
A container that groups Rules 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.HttpURIHandlerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainer -
Field Summary
FieldsFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds aRuleto the existing ones.voiddump(Appendable out, String indent) getRules()iterator()matchAndApply(Rule.Handler input) Processes the rules.voidsetOriginalPathAttribute(String originalPathAttribute) Sets a request attribute name that will be used to store the request original path.voidMethods inherited from class org.eclipse.jetty.rewrite.handler.Rule
isTerminating, setTerminating, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dump, dumpSelfMethods 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
Rules
-
setRules
- Parameters:
rules- the list ofRule.
-
iterator
-
addRule
Adds a
Ruleto the existing ones.- Parameters:
rule- the rule to add to the rules list
-
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:
matchAndApplyin classRule- Parameters:
input- the inputRequestandHandler- Returns:
- a
RequestandHandler, possibly wrapped by rules to implement the rule's logic, ornullif no rule matched - Throws:
IOException- if applying the rule failed
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Throws:
IOException
-