Package org.trellisldp.common
Class Forwarded
- java.lang.Object
-
- org.trellisldp.common.Forwarded
-
public class Forwarded extends Object
A class representing an HTTP Forwarded header.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
getBy()
Optional<String>
getFor()
Optional<String>
getHost()
Optional<String>
getHostname()
OptionalInt
getPort()
Optional<String>
getProto()
static Forwarded
valueOf(String value)
Get a Forwarded object from a header value.
-
-
-
Field Detail
-
HTTP
public static final String HTTP
- See Also:
- Constant Field Values
-
HTTPS
public static final String HTTPS
- See Also:
- Constant Field Values
-
-
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 serverforwardedFor
- the client that initiated the requestforwardedHost
- the host request header field, as received by the proxyforwardedProto
- the protocol used to make the request
-
-
Method Detail
-
getPort
public OptionalInt getPort()
- Returns:
- the port, if present
-
-