Class HttpRequest (3.21.0)

public final class HttpRequest implements Serializable

Objects of this class represent information about the (optional) HTTP request associated with a log entry. See Also: Http Request

Inheritance

Object > HttpRequest

Implements

Serializable

Static Fields

EMPTY

public static final HttpRequest EMPTY
Field Value
Type Description
HttpRequest

Static Methods

newBuilder()

public static HttpRequest.Builder newBuilder()

Returns a builder for HttpRequest objects.

Returns
Type Description
HttpRequest.Builder

Methods

cacheHit()

public boolean cacheHit()

Returns whether or not an entity was served from cache (with or without validation). If not set, this method returns false.

Returns
Type Description
boolean

cacheLookup()

public boolean cacheLookup()

Returns whether or not a cache lookup was attempted. If not set, this method returns false.

Returns
Type Description
boolean

cacheValidatedWithOriginServer()

public boolean cacheValidatedWithOriginServer()

Returns whether or not the response was validated with the origin server before being served from cache. If not set, this method returns false. This field is only meaningful if #cacheHit() is set to true.

Returns
Type Description
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCacheFillBytes()

public Long getCacheFillBytes()

Returns the number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.

Returns
Type Description
Long

getLatency()

public Duration getLatency()

This method is obsolete. Use #getLatencyDuration() instead.

Returns
Type Description
org.threeten.bp.Duration

getLatencyDuration()

public Duration getLatencyDuration()

Returns the processing latency on the server, from the time the request was received until the response was sent.

Returns
Type Description
Duration

the latency, for null if not populated.

getReferer()

public String getReferer()

Returns the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions. See Also: HTTP/1.1 Header Field Definitions

Returns
Type Description
String

getRemoteIp()

public String getRemoteIp()

Returns the IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: 192.168.1.1, FE80::0202:B3FF:FE1E:8329.

Returns
Type Description
String

getRequestMethod()

public HttpRequest.RequestMethod getRequestMethod()

Returns the HTTP request method.

Returns
Type Description
HttpRequest.RequestMethod

getRequestSize()

public Long getRequestSize()

Returns the size of the HTTP request message in bytes, including the request headers and the request body.

Returns
Type Description
Long

getRequestUrl()

public String getRequestUrl()

Returns the requested URL. Request URL contains the scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: http://example.com/some/info?color=red.

Returns
Type Description
String

getResponseSize()

public Long getResponseSize()

Returns the size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.

Returns
Type Description
Long

getServerIp()

public String getServerIp()

Returns the IP address (IPv4 or IPv6) of the origin server that the request was sent to. Examples: 192.168.1.1, FE80::0202:B3FF:FE1E:8329.

Returns
Type Description
String

getStatus()

public Integer getStatus()

Returns the response code indicating the status of response.

Returns
Type Description
Integer

getUserAgent()

public String getUserAgent()

Returns the user agent sent by the client. Example: Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705).

Returns
Type Description
String

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

toBuilder()

public HttpRequest.Builder toBuilder()

Returns a builder for this object.

Returns
Type Description
HttpRequest.Builder

toString()

public String toString()
Returns
Type Description
String
Overrides