Class Forwarded


  • public class Forwarded
    extends Object
    A class representing an HTTP Forwarded header.
    • Constructor Detail

      • Forwarded

        public Forwarded​(String forwardedBy,
                         String forwardedFor,
                         String forwardedHost,
                         String forwardedProto)
        Create a Forwarded object.
        Parameters:
        forwardedBy - the interface where the request came in to the proxy server
        forwardedFor - the client that initiated the request
        forwardedHost - the host request header field, as received by the proxy
        forwardedProto - the protocol used to make the request
    • Method Detail

      • getBy

        public Optional<String> getBy()
        Returns:
        the by parameter, if present
      • getFor

        public Optional<String> getFor()
        Returns:
        the for parameter, if present
      • getHost

        public Optional<String> getHost()
        Returns:
        the host parameter, if present
      • getProto

        public Optional<String> getProto()
        Returns:
        the proto parameter, if present
      • getPort

        public OptionalInt getPort()
        Returns:
        the port, if present
      • getHostname

        public Optional<String> getHostname()
        Returns:
        the hostname, if present
      • valueOf

        public static Forwarded valueOf​(String value)
        Get a Forwarded object from a header value.
        Parameters:
        value - the header value
        Returns:
        the Forwarded object or null, if not present;