Package com.google.cloud.logging
Class HttpRequest
java.lang.Object
com.google.cloud.logging.HttpRequest
- All Implemented Interfaces:
Serializable
Objects of this class represent information about the (optional) HTTP request associated with a
log entry.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder forHttpRequestobjects.static final classThe HTTP request method. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleancacheHit()Returns whether or not an entity was served from cache (with or without validation).booleanReturns whether or not a cache lookup was attempted.booleanReturns whether or not the response was validated with the origin server before being served from cache.booleanReturns the number of HTTP response bytes inserted into cache.org.threeten.bp.DurationThis method is obsolete.Returns the processing latency on the server, from the time the request was received until the response was sent.Returns the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.Returns the IP address (IPv4 or IPv6) of the client that issued the HTTP request.Returns the HTTP request method.Returns the size of the HTTP request message in bytes, including the request headers and the request body.Returns the requested URL.Returns the size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.Returns the IP address (IPv4 or IPv6) of the origin server that the request was sent to.Returns the response code indicating the status of response.Returns the user agent sent by the client.inthashCode()static HttpRequest.BuilderReturns a builder forHttpRequestobjects.Returns a builder for this object.toString()
-
Field Details
-
EMPTY
-
-
Method Details
-
getRequestMethod
Returns the HTTP request method. -
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. -
getRequestSize
Returns the size of the HTTP request message in bytes, including the request headers and the request body. -
getStatus
Returns the response code indicating the status of response. -
getResponseSize
Returns the size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body. -
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). -
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. -
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. -
getReferer
Returns the referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.- See Also:
-
cacheLookup
public boolean cacheLookup()Returns whether or not a cache lookup was attempted. If not set, this method returnsfalse. -
cacheHit
public boolean cacheHit()Returns whether or not an entity was served from cache (with or without validation). If not set, this method returnsfalse. -
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 returnsfalse. This field is only meaningful ifcacheHit()is set totrue. -
getCacheFillBytes
Returns the number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted. -
getLatency
@ObsoleteApi("Use getLatencyDuration() instead") public org.threeten.bp.Duration getLatency()This method is obsolete. UsegetLatencyDuration()instead. -
getLatencyDuration
Returns the processing latency on the server, from the time the request was received until the response was sent.- Returns:
- the latency, for null if not populated.
-
hashCode
public int hashCode() -
toString
-
equals
-
toBuilder
Returns a builder for this object. -
newBuilder
Returns a builder forHttpRequestobjects.
-