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 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
Dumpable.DumpableContainer, Dumpable.DumpAppendable -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds aRuleto the existing ones.voidclear()Removes all the rules.voiddump(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.voidsetOriginalPathAttribute(String originalPathAttribute) Sets a request attribute name that will be used to store the request original path.voidSet the list ofRule..Methods 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 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
Set the list ofRule..- Parameters:
rules- the list ofRule.
-
iterator
-
addRule
Adds a
Ruleto 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:
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 fails
-
dump
Description copied from interface:DumpableDump 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:
dumpin interfaceDumpable- Parameters:
out- The appendable to dump toindent- The indent to apply after any new lines.- Throws:
IOException- if unable to write to Appendable
-