Class VirtualHostRuleContainer
java.lang.Object
org.eclipse.jetty.rewrite.handler.Rule
org.eclipse.jetty.rewrite.handler.RuleContainer
org.eclipse.jetty.rewrite.handler.VirtualHostRuleContainer
- All Implemented Interfaces:
Dumpable
Groups rules that apply only to a specific virtual host
or sets of virtual hosts
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.rewrite.handler.Rule
Rule.ApplyURI
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Field Summary
Fields inherited from class org.eclipse.jetty.rewrite.handler.RuleContainer
_originalPathAttribute, _originalQueryStringAttribute, _rewritePathInfo, _rewriteRequestURI, _rules, ORIGINAL_QUERYSTRING_ATTRIBUTE_SUFFIX
Fields inherited from class org.eclipse.jetty.rewrite.handler.Rule
_handling, _terminating
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addVirtualHost
(String virtualHost) String[]
Get the virtual hosts that the rules within this container will apply tomatchAndApply
(String target, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Process the contained rules if the request is applicable to the virtual hosts of this rulevoid
setVirtualHosts
(String[] virtualHosts) Set the virtual hosts that the rules within this container will apply toMethods inherited from class org.eclipse.jetty.rewrite.handler.RuleContainer
addRule, apply, dump, getOriginalPathAttribute, getRules, isRewritePathInfo, isRewriteRequestURI, setOriginalPathAttribute, setRewritePathInfo, setRewriteRequestURI, setRules
Methods inherited from class org.eclipse.jetty.rewrite.handler.Rule
isHandling, isTerminating, setHandling, setTerminating, toString
-
Constructor Details
-
VirtualHostRuleContainer
public VirtualHostRuleContainer()
-
-
Method Details
-
setVirtualHosts
Set the virtual hosts that the rules within this container will apply to- Parameters:
virtualHosts
- Array of virtual hosts that the rules within this container are applied to. A null hostname or null/empty array means any hostname is acceptable.
-
getVirtualHosts
Get the virtual hosts that the rules within this container will apply to- Returns:
- Array of virtual hosts that the rules within this container are applied to. A null hostname or null/empty array means any hostname is acceptable.
-
addVirtualHost
- Parameters:
virtualHost
- add a virtual host to the existing list of virtual hosts A null hostname means any hostname is acceptable
-
matchAndApply
public String matchAndApply(String target, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException Process the contained rules if the request is applicable to the virtual hosts of this rule- Overrides:
matchAndApply
in classRuleContainer
- Parameters:
target
- target field to pass on to the contained rulesrequest
- request object to pass on to the contained rulesresponse
- response object to pass on to the contained rules- Returns:
- The new target if the rule has matched, else null
- Throws:
IOException
- if unable to match the rule
-