Class HostDirectives

Direct Known Subclasses:
MarshallingDirectives

public abstract class HostDirectives extends AttributeDirectives
  • Constructor Details

    • HostDirectives

      public HostDirectives()
  • Method Details

    • extractHost

      public Route extractHost(Function<String,Route> inner)
      Extracts the hostname part of the Host request header value.
      Parameters:
      inner - (undocumented)
      Returns:
      (undocumented)
    • host

      public Route host(Iterable<String> hostNames, Supplier<Route> inner)
      Rejects all requests with a host name different from the given ones.
      Parameters:
      hostNames - (undocumented)
      inner - (undocumented)
      Returns:
      (undocumented)
    • host

      public Route host(String hostName, Supplier<Route> inner)
      Rejects all requests with a host name different from the given one.
      Parameters:
      hostName - (undocumented)
      inner - (undocumented)
      Returns:
      (undocumented)
    • host

      public Route host(Predicate<String> predicate, Supplier<Route> inner)
      Rejects all requests for whose host name the given predicate function returns false.
      Parameters:
      predicate - (undocumented)
      inner - (undocumented)
      Returns:
      (undocumented)
    • host

      public Route host(Pattern regex, Function<String,Route> inner)
      Rejects all requests with a host name that doesn't have a prefix matching the given regular expression. For all matching requests the prefix string matching the regex is extracted and passed to the inner route. If the regex contains a capturing group only the string matched by this group is extracted. If the regex contains more than one capturing group an IllegalArgumentException is thrown.
      Parameters:
      regex - (undocumented)
      inner - (undocumented)
      Returns:
      (undocumented)