Class HttpRequest.Builder (2.29.0)

public static final class HttpRequest.Builder extends GeneratedMessageV3.Builder<HttpRequest.Builder> implements HttpRequestOrBuilder

A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message.

Protobuf type google.logging.type.HttpRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public HttpRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
HttpRequest.Builder
Overrides

build()

public HttpRequest build()
Returns
TypeDescription
HttpRequest

buildPartial()

public HttpRequest buildPartial()
Returns
TypeDescription
HttpRequest

clear()

public HttpRequest.Builder clear()
Returns
TypeDescription
HttpRequest.Builder
Overrides

clearCacheFillBytes()

public HttpRequest.Builder clearCacheFillBytes()

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

int64 cache_fill_bytes = 12;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearCacheHit()

public HttpRequest.Builder clearCacheHit()

Whether or not an entity was served from cache (with or without validation).

bool cache_hit = 9;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearCacheLookup()

public HttpRequest.Builder clearCacheLookup()

Whether or not a cache lookup was attempted.

bool cache_lookup = 11;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearCacheValidatedWithOriginServer()

public HttpRequest.Builder clearCacheValidatedWithOriginServer()

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

bool cache_validated_with_origin_server = 10;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public HttpRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
HttpRequest.Builder
Overrides

clearLatency()

public HttpRequest.Builder clearLatency()

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

.google.protobuf.Duration latency = 14;

Returns
TypeDescription
HttpRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public HttpRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
HttpRequest.Builder
Overrides

clearProtocol()

public HttpRequest.Builder clearProtocol()

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

string protocol = 15;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearReferer()

public HttpRequest.Builder clearReferer()

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

string referer = 8;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearRemoteIp()

public HttpRequest.Builder clearRemoteIp()

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

string remote_ip = 7;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearRequestMethod()

public HttpRequest.Builder clearRequestMethod()

The request method. Examples: "GET", "HEAD", "PUT", "POST".

string request_method = 1;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearRequestSize()

public HttpRequest.Builder clearRequestSize()

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

int64 request_size = 3;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearRequestUrl()

public HttpRequest.Builder clearRequestUrl()

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".

string request_url = 2;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearResponseSize()

public HttpRequest.Builder clearResponseSize()

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

int64 response_size = 5;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearServerIp()

public HttpRequest.Builder clearServerIp()

The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

string server_ip = 13;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearStatus()

public HttpRequest.Builder clearStatus()

The response code indicating the status of response. Examples: 200, 404.

int32 status = 4;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clearUserAgent()

public HttpRequest.Builder clearUserAgent()

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

string user_agent = 6;

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

clone()

public HttpRequest.Builder clone()
Returns
TypeDescription
HttpRequest.Builder
Overrides

getCacheFillBytes()

public long getCacheFillBytes()

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

int64 cache_fill_bytes = 12;

Returns
TypeDescription
long

The cacheFillBytes.

getCacheHit()

public boolean getCacheHit()

Whether or not an entity was served from cache (with or without validation).

bool cache_hit = 9;

Returns
TypeDescription
boolean

The cacheHit.

getCacheLookup()

public boolean getCacheLookup()

Whether or not a cache lookup was attempted.

bool cache_lookup = 11;

Returns
TypeDescription
boolean

The cacheLookup.

getCacheValidatedWithOriginServer()

public boolean getCacheValidatedWithOriginServer()

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

bool cache_validated_with_origin_server = 10;

Returns
TypeDescription
boolean

The cacheValidatedWithOriginServer.

getDefaultInstanceForType()

public HttpRequest getDefaultInstanceForType()
Returns
TypeDescription
HttpRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getLatency()

public Duration getLatency()

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

.google.protobuf.Duration latency = 14;

Returns
TypeDescription
Duration

The latency.

getLatencyBuilder()

public Duration.Builder getLatencyBuilder()

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

.google.protobuf.Duration latency = 14;

Returns
TypeDescription
Builder

getLatencyOrBuilder()

public DurationOrBuilder getLatencyOrBuilder()

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

.google.protobuf.Duration latency = 14;

Returns
TypeDescription
DurationOrBuilder

getProtocol()

public String getProtocol()

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

string protocol = 15;

Returns
TypeDescription
String

The protocol.

getProtocolBytes()

public ByteString getProtocolBytes()

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

string protocol = 15;

Returns
TypeDescription
ByteString

The bytes for protocol.

getReferer()

public String getReferer()

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

string referer = 8;

Returns
TypeDescription
String

The referer.

getRefererBytes()

public ByteString getRefererBytes()

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

string referer = 8;

Returns
TypeDescription
ByteString

The bytes for referer.

getRemoteIp()

public String getRemoteIp()

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

string remote_ip = 7;

Returns
TypeDescription
String

The remoteIp.

getRemoteIpBytes()

public ByteString getRemoteIpBytes()

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

string remote_ip = 7;

Returns
TypeDescription
ByteString

The bytes for remoteIp.

getRequestMethod()

public String getRequestMethod()

The request method. Examples: "GET", "HEAD", "PUT", "POST".

string request_method = 1;

Returns
TypeDescription
String

The requestMethod.

getRequestMethodBytes()

public ByteString getRequestMethodBytes()

The request method. Examples: "GET", "HEAD", "PUT", "POST".

string request_method = 1;

Returns
TypeDescription
ByteString

The bytes for requestMethod.

getRequestSize()

public long getRequestSize()

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

int64 request_size = 3;

Returns
TypeDescription
long

The requestSize.

getRequestUrl()

public String getRequestUrl()

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".

string request_url = 2;

Returns
TypeDescription
String

The requestUrl.

getRequestUrlBytes()

public ByteString getRequestUrlBytes()

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".

string request_url = 2;

Returns
TypeDescription
ByteString

The bytes for requestUrl.

getResponseSize()

public long getResponseSize()

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

int64 response_size = 5;

Returns
TypeDescription
long

The responseSize.

getServerIp()

public String getServerIp()

The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

string server_ip = 13;

Returns
TypeDescription
String

The serverIp.

getServerIpBytes()

public ByteString getServerIpBytes()

The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

string server_ip = 13;

Returns
TypeDescription
ByteString

The bytes for serverIp.

getStatus()

public int getStatus()

The response code indicating the status of response. Examples: 200, 404.

int32 status = 4;

Returns
TypeDescription
int

The status.

getUserAgent()

public String getUserAgent()

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

string user_agent = 6;

Returns
TypeDescription
String

The userAgent.

getUserAgentBytes()

public ByteString getUserAgentBytes()

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

string user_agent = 6;

Returns
TypeDescription
ByteString

The bytes for userAgent.

hasLatency()

public boolean hasLatency()

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

.google.protobuf.Duration latency = 14;

Returns
TypeDescription
boolean

Whether the latency field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(HttpRequest other)

public HttpRequest.Builder mergeFrom(HttpRequest other)
Parameter
NameDescription
otherHttpRequest
Returns
TypeDescription
HttpRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public HttpRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
HttpRequest.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public HttpRequest.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
HttpRequest.Builder
Overrides

mergeLatency(Duration value)

public HttpRequest.Builder mergeLatency(Duration value)

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

.google.protobuf.Duration latency = 14;

Parameter
NameDescription
valueDuration
Returns
TypeDescription
HttpRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final HttpRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
HttpRequest.Builder
Overrides

setCacheFillBytes(long value)

public HttpRequest.Builder setCacheFillBytes(long value)

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

int64 cache_fill_bytes = 12;

Parameter
NameDescription
valuelong

The cacheFillBytes to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setCacheHit(boolean value)

public HttpRequest.Builder setCacheHit(boolean value)

Whether or not an entity was served from cache (with or without validation).

bool cache_hit = 9;

Parameter
NameDescription
valueboolean

The cacheHit to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setCacheLookup(boolean value)

public HttpRequest.Builder setCacheLookup(boolean value)

Whether or not a cache lookup was attempted.

bool cache_lookup = 11;

Parameter
NameDescription
valueboolean

The cacheLookup to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setCacheValidatedWithOriginServer(boolean value)

public HttpRequest.Builder setCacheValidatedWithOriginServer(boolean value)

Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.

bool cache_validated_with_origin_server = 10;

Parameter
NameDescription
valueboolean

The cacheValidatedWithOriginServer to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public HttpRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
HttpRequest.Builder
Overrides

setLatency(Duration value)

public HttpRequest.Builder setLatency(Duration value)

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

.google.protobuf.Duration latency = 14;

Parameter
NameDescription
valueDuration
Returns
TypeDescription
HttpRequest.Builder

setLatency(Duration.Builder builderForValue)

public HttpRequest.Builder setLatency(Duration.Builder builderForValue)

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

.google.protobuf.Duration latency = 14;

Parameter
NameDescription
builderForValueBuilder
Returns
TypeDescription
HttpRequest.Builder

setProtocol(String value)

public HttpRequest.Builder setProtocol(String value)

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

string protocol = 15;

Parameter
NameDescription
valueString

The protocol to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setProtocolBytes(ByteString value)

public HttpRequest.Builder setProtocolBytes(ByteString value)

Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"

string protocol = 15;

Parameter
NameDescription
valueByteString

The bytes for protocol to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setReferer(String value)

public HttpRequest.Builder setReferer(String value)

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

string referer = 8;

Parameter
NameDescription
valueString

The referer to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setRefererBytes(ByteString value)

public HttpRequest.Builder setRefererBytes(ByteString value)

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions.

string referer = 8;

Parameter
NameDescription
valueByteString

The bytes for referer to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setRemoteIp(String value)

public HttpRequest.Builder setRemoteIp(String value)

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

string remote_ip = 7;

Parameter
NameDescription
valueString

The remoteIp to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setRemoteIpBytes(ByteString value)

public HttpRequest.Builder setRemoteIpBytes(ByteString value)

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

string remote_ip = 7;

Parameter
NameDescription
valueByteString

The bytes for remoteIp to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public HttpRequest.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
HttpRequest.Builder
Overrides

setRequestMethod(String value)

public HttpRequest.Builder setRequestMethod(String value)

The request method. Examples: "GET", "HEAD", "PUT", "POST".

string request_method = 1;

Parameter
NameDescription
valueString

The requestMethod to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setRequestMethodBytes(ByteString value)

public HttpRequest.Builder setRequestMethodBytes(ByteString value)

The request method. Examples: "GET", "HEAD", "PUT", "POST".

string request_method = 1;

Parameter
NameDescription
valueByteString

The bytes for requestMethod to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setRequestSize(long value)

public HttpRequest.Builder setRequestSize(long value)

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

int64 request_size = 3;

Parameter
NameDescription
valuelong

The requestSize to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setRequestUrl(String value)

public HttpRequest.Builder setRequestUrl(String value)

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".

string request_url = 2;

Parameter
NameDescription
valueString

The requestUrl to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setRequestUrlBytes(ByteString value)

public HttpRequest.Builder setRequestUrlBytes(ByteString value)

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".

string request_url = 2;

Parameter
NameDescription
valueByteString

The bytes for requestUrl to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setResponseSize(long value)

public HttpRequest.Builder setResponseSize(long value)

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

int64 response_size = 5;

Parameter
NameDescription
valuelong

The responseSize to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setServerIp(String value)

public HttpRequest.Builder setServerIp(String value)

The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

string server_ip = 13;

Parameter
NameDescription
valueString

The serverIp to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setServerIpBytes(ByteString value)

public HttpRequest.Builder setServerIpBytes(ByteString value)

The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: "192.168.1.1", "10.0.0.1:80", "FE80::0202:B3FF:FE1E:8329".

string server_ip = 13;

Parameter
NameDescription
valueByteString

The bytes for serverIp to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setStatus(int value)

public HttpRequest.Builder setStatus(int value)

The response code indicating the status of response. Examples: 200, 404.

int32 status = 4;

Parameter
NameDescription
valueint

The status to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final HttpRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
HttpRequest.Builder
Overrides

setUserAgent(String value)

public HttpRequest.Builder setUserAgent(String value)

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

string user_agent = 6;

Parameter
NameDescription
valueString

The userAgent to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.

setUserAgentBytes(ByteString value)

public HttpRequest.Builder setUserAgentBytes(ByteString value)

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

string user_agent = 6;

Parameter
NameDescription
valueByteString

The bytes for userAgent to set.

Returns
TypeDescription
HttpRequest.Builder

This builder for chaining.