Class HttpRequest (3.10.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
TypeDescription
HttpRequest

Static Methods

newBuilder()

public static HttpRequest.Builder newBuilder()

Returns a builder for HttpRequest objects.

Returns
TypeDescription
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
TypeDescription
boolean

cacheLookup()

public boolean cacheLookup()

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

Returns
TypeDescription
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
TypeDescription
boolean

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
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
TypeDescription
Long

getLatency()

public Duration getLatency()

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

Returns
TypeDescription
org.threeten.bp.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
TypeDescription
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
TypeDescription
String

getRequestMethod()

public HttpRequest.RequestMethod getRequestMethod()

Returns the HTTP request method.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
String

getStatus()

public Integer getStatus()

Returns the response code indicating the status of response.

Returns
TypeDescription
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
TypeDescription
String

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

toBuilder()

public HttpRequest.Builder toBuilder()

Returns a builder for this object.

Returns
TypeDescription
HttpRequest.Builder

toString()

public String toString()
Returns
TypeDescription
String
Overrides