Package org.forgerock.http.header
Class ForwardedHeader
java.lang.Object
org.forgerock.http.protocol.Header
org.forgerock.http.header.ForwardedHeader
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
This class represents a request's hop detail. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdd a new hop detail at the end of the list of hops.boolean
Get the first request's hop information (for, by, host and proto) as expressed in the header (ie: contents may not be well formatted).getHops()
Get the list of request's hops details.Get the last request's hop information (for, by, host and proto) as expressed in the header (ie: contents may not be well formatted).Get the last request's hop IP address.getName()
Returns the name of the header, as it would canonically appear within an HTTP message.Get the first request's hop IP address.Returns the header as a list of strings.int
hashCode()
Methods inherited from class org.forgerock.http.protocol.Header
getFirstValue, toString
-
Field Details
-
NAME
The name of the header in the HTTP message.- See Also:
-
-
Constructor Details
-
ForwardedHeader
public ForwardedHeader()
-
-
Method Details
-
getName
Description copied from class:Header
Returns the name of the header, as it would canonically appear within an HTTP message. -
getValues
Description copied from class:Header
Returns the header as a list of strings. If the header has no values then it must return an empty list, never null. EachString
should represent the value component of the key-value pair that makes up the HTTP header - as such, for someHeader
implementations each String in thisList
may contain multiple token-separated values.The
List
returned from this method should not be expected to be mutable. However, some subclasses ofHeader
may choose to implement it as such. -
getLastHop
Get the last request's hop information (for, by, host and proto) as expressed in the header (ie: contents may not be well formatted).This usually is the last encountered proxy details.
- Returns:
- the last hop details (or
null
if there is no hop listed)
-
getLastHopClientIp
Get the last request's hop IP address. This IP is either IPv4, IPv6 or null if not found.- Returns:
- the last hop IP address.
null
if not present or not an IPv4 nor IPv6.
-
getFirstHop
Get the first request's hop information (for, by, host and proto) as expressed in the header (ie: contents may not be well formatted).- Returns:
- the first hop details (or
null
if there is no hop listed)
-
getOriginatingClientIp
Get the first request's hop IP address. This IP is either IPv4, IPv6 or null if not found.- Returns:
- the last hop IP address.
null
if not present or not an IPv4 nor IPv6.
-
getHops
Get the list of request's hops details.The first element is the originating client, the last element is the last proxy encountered.
- Returns:
- the list of request's hops details. this list is immutable.
-
addHop
Add a new hop detail at the end of the list of hops.- Parameters:
hop
- the detail of the new hop.- Returns:
- the header itself to be able to chain method calls.
-
equals
-
hashCode
public int hashCode()
-