Class ResponseStatusHeaderRegexRule
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.ResponseStatusHeaderRegexRule
Sends a response with the configured status code whenever the value of the configured request header matches a regular expression.
- 
Nested Class Summary
Nested classes/interfaces inherited from class Rule
Rule.Handler, Rule.HttpURIHandler - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionapply(Rule.Handler input, String value) intgetCode()booleanmatchAndApply(Rule.Handler input) Tests whether the given inputHandler(which wraps aRequest) matches the rule, and if so returns an outputHandlerthat applies the rule logic.voidsetCode(int code) Set the http status code returned on a match.voidsetHeaderName(String headerName) Set the http header to match onvoidsetHeaderRegex(String headerRegex) Set the regex to match against the header value, null to match on any valuevoidsetMessage(String message) Sets the message for the response body.toString()Methods inherited from class Rule
setTerminating 
- 
Constructor Details
- 
ResponseStatusHeaderRegexRule
public ResponseStatusHeaderRegexRule() 
 - 
 - 
Method Details
- 
isTerminating
public boolean isTerminating()- Overrides:
 isTerminatingin classRule- Returns:
 - whether rules after this one are not invoked
 
 - 
getHeaderName
 - 
setHeaderName
Set the http header to match on- Parameters:
 headerName- the http header to match on
 - 
getHeaderRegex
 - 
setHeaderRegex
Set the regex to match against the header value, null to match on any value- Parameters:
 headerRegex- regex to match against the header value
 - 
getCode
public int getCode() - 
setCode
public void setCode(int code) Set the http status code returned on a match.- Parameters:
 code- the http status code
 - 
getMessage
 - 
setMessage
Sets the message for the response body.
- Parameters:
 message- the response body message
 - 
matchAndApply
Description copied from class:RuleTests whether the given input
Handler(which wraps aRequest) matches the rule, and if so returns an outputHandlerthat applies the rule logic.If the input does not match,
nullis returned.- Specified by:
 matchAndApplyin classRule- Parameters:
 input- the inputHandlerthat wraps theRequest- Returns:
 - an output 
Handlerthat wraps the inputHandler, ornullif the rule does not match - Throws:
 IOException- if applying the rule fails
 - 
apply
- Throws:
 IOException
 - 
toString
 
 -