Class VirtualHostRuleContainer

All Implemented Interfaces:
Dumpable

public class VirtualHostRuleContainer extends RuleContainer
Groups rules that apply only to a specific virtual host or sets of virtual hosts
  • Constructor Details

    • VirtualHostRuleContainer

      public VirtualHostRuleContainer()
  • Method Details

    • setVirtualHosts

      public void setVirtualHosts(String[] virtualHosts)
      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

      public String[] 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

      public void addVirtualHost(String virtualHost)
      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, javax.servlet.http.HttpServletRequest request, javax.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 class RuleContainer
      Parameters:
      target - target field to pass on to the contained rules
      request - request object to pass on to the contained rules
      response - 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