Class Rule
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
- Direct Known Subclasses:
CompactPathRule
,ForceRequestHeaderValueRule
,HeaderRule
,MsieRule
,MsieSslRule
,PatternRule
,RegexRule
,RuleContainer
,ValidUrlRule
An abstract rule for creating rewrite rules.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Interface used to apply a changed target ifRuleContainer.setRewriteRequestURI(boolean)
is true. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the handling flag value.boolean
Returns the terminating flag value.abstract String
matchAndApply
(String target, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) This method calls tests the rule against the request/response pair and if the Rule applies, then the rule's action is triggered.void
setHandling
(boolean handling) Set the handling flag value.void
setTerminating
(boolean terminating) Sets terminating to true or false.toString()
Returns the handling and terminating flag values.
-
Field Details
-
_terminating
protected boolean _terminating -
_handling
protected boolean _handling
-
-
Constructor Details
-
Rule
public Rule()
-
-
Method Details
-
matchAndApply
public abstract String matchAndApply(String target, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException This method calls tests the rule against the request/response pair and if the Rule applies, then the rule's action is triggered.- Parameters:
target
- The target of the requestrequest
- the requestresponse
- the response- Returns:
- The new target if the rule has matched, else null
- Throws:
IOException
- if unable to match the rule
-
setTerminating
public void setTerminating(boolean terminating) Sets terminating to true or false.- Parameters:
terminating
- If true, this rule will terminate the loop if this rule has been applied.
-
isTerminating
public boolean isTerminating()Returns the terminating flag value.- Returns:
true
if the rule needs to terminate;false
otherwise.
-
isHandling
public boolean isHandling()Returns the handling flag value.- Returns:
true
if the rule handles the request and nested handlers should not be called.
-
setHandling
public void setHandling(boolean handling) Set the handling flag value.- Parameters:
handling
- true if the rule handles the request and nested handlers should not be called.
-
toString
Returns the handling and terminating flag values.
-