Class VirtualHostRuleContainer

All Implemented Interfaces:
Iterable<Rule>, Dumpable

public class VirtualHostRuleContainer extends RuleContainer

Groups rules that apply only to one or more specific virtual hosts.

  • Constructor Details

    • VirtualHostRuleContainer

      public VirtualHostRuleContainer()
  • Method Details

    • getVirtualHosts

      public List<String> getVirtualHosts()
      Returns:
      the virtual hosts to match
    • setVirtualHosts

      public void setVirtualHosts(List<String> virtualHosts)

      Sets the virtual hosts to match for the rules within this container to be applied.

      Parameters:
      virtualHosts - the virtual hosts to match
    • addVirtualHost

      public void addVirtualHost(String virtualHost)
      Add the virtual host to add to the existing list of virtual hosts.
      Parameters:
      virtualHost - the virtual host to add to the existing list of virtual hosts
    • matchAndApply

      public Rule.Handler matchAndApply(Rule.Handler input) throws IOException
      Description copied from class: RuleContainer

      Processes the rules.

      Overrides:
      matchAndApply in class RuleContainer
      Parameters:
      input - the input Request and Handler
      Returns:
      a Request and Handler, possibly wrapped by rules to implement the rule's logic, or null if no rule matched
      Throws:
      IOException - if applying the rule fails