Class Rule
- java.lang.Object
-
- org.eclipse.jetty.rewrite.handler.Rule
-
- Direct Known Subclasses:
CompactPathRule,ForceRequestHeaderValueRule,HeaderRule,MsieSslRule,PatternRule,RegexRule,RuleContainer,ValidUrlRule
public abstract class Rule extends java.lang.ObjectAn abstract rule for creating rewrite rules.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceRule.ApplyURIInterface used to apply a changed target ifRuleContainer.setRewriteRequestURI(boolean)is true.
-
Field Summary
Fields Modifier and Type Field Description protected boolean_handlingprotected boolean_terminating
-
Constructor Summary
Constructors Constructor Description Rule()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanisHandling()Returns the handling flag value.booleanisTerminating()Returns the terminating flag value.abstract java.lang.StringmatchAndApply(java.lang.String target, javax.servlet.http.HttpServletRequest request, javax.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.voidsetHandling(boolean handling)Set the handling flag value.voidsetTerminating(boolean terminating)Sets terminating to true or false.java.lang.StringtoString()Returns the handling and terminating flag values.
-
-
-
Method Detail
-
matchAndApply
public abstract java.lang.String matchAndApply(java.lang.String target, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOExceptionThis 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:
java.io.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:
trueif the rule needs to terminate;falseotherwise.
-
isHandling
public boolean isHandling()
Returns the handling flag value.- Returns:
trueif 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
public java.lang.String toString()
Returns the handling and terminating flag values.- Overrides:
toStringin classjava.lang.Object
-
-