Class HostDirectives

    • Constructor Detail

      • HostDirectives

        public HostDirectives()
    • Method Detail

      • extractHost

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

        public Route host​(java.lang.Iterable<java.lang.String> hostNames,
                          java.util.function.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​(java.lang.String hostName,
                          java.util.function.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​(java.util.function.Predicate<java.lang.String> predicate,
                          java.util.function.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​(java.util.regex.Pattern regex,
                          java.util.function.Function<java.lang.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)