Class HttpRequest.Builder (1.48.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.api.servicecontrol.v1.HttpRequest

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

Methods

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public HttpRequest.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
HttpRequest.Builder
Overrides

build()

public HttpRequest build()
Returns
Type Description
HttpRequest

buildPartial()

public HttpRequest buildPartial()
Returns
Type Description
HttpRequest

clear()

public HttpRequest.Builder clear()
Returns
Type Description
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
Type Description
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
Type Description
HttpRequest.Builder

This builder for chaining.

clearCacheLookup()

public HttpRequest.Builder clearCacheLookup()

Whether or not a cache lookup was attempted.

bool cache_lookup = 11;

Returns
Type Description
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
Type Description
HttpRequest.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public HttpRequest.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
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
Type Description
HttpRequest.Builder

clearOneof(Descriptors.OneofDescriptor oneof)

public HttpRequest.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
HttpRequest.Builder
Overrides

clearProtocol()

public HttpRequest.Builder clearProtocol()

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

string protocol = 15;

Returns
Type Description
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
Type Description
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. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

string remote_ip = 7;

Returns
Type Description
HttpRequest.Builder

This builder for chaining.

clearRequestMethod()

public HttpRequest.Builder clearRequestMethod()

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

string request_method = 1;

Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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.

string server_ip = 13;

Returns
Type Description
HttpRequest.Builder

This builder for chaining.

clearStatus()

public HttpRequest.Builder clearStatus()

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

int32 status = 4;

Returns
Type Description
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
Type Description
HttpRequest.Builder

This builder for chaining.

clone()

public HttpRequest.Builder clone()
Returns
Type Description
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
Type Description
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
Type Description
boolean

The cacheHit.

getCacheLookup()

public boolean getCacheLookup()

Whether or not a cache lookup was attempted.

bool cache_lookup = 11;

Returns
Type Description
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
Type Description
boolean

The cacheValidatedWithOriginServer.

getDefaultInstanceForType()

public HttpRequest getDefaultInstanceForType()
Returns
Type Description
HttpRequest

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
DurationOrBuilder

getProtocol()

public String getProtocol()

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

string protocol = 15;

Returns
Type Description
String

The protocol.

getProtocolBytes()

public ByteString getProtocolBytes()

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

string protocol = 15;

Returns
Type Description
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
Type Description
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
Type Description
ByteString

The bytes for referer.

getRemoteIp()

public String getRemoteIp()

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

string remote_ip = 7;

Returns
Type Description
String

The remoteIp.

getRemoteIpBytes()

public ByteString getRemoteIpBytes()

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

string remote_ip = 7;

Returns
Type Description
ByteString

The bytes for remoteIp.

getRequestMethod()

public String getRequestMethod()

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

string request_method = 1;

Returns
Type Description
String

The requestMethod.

getRequestMethodBytes()

public ByteString getRequestMethodBytes()

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

string request_method = 1;

Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
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
Type Description
long

The responseSize.

getServerIp()

public String getServerIp()

The IP address (IPv4 or IPv6) of the origin server that the request was sent to.

string server_ip = 13;

Returns
Type Description
String

The serverIp.

getServerIpBytes()

public ByteString getServerIpBytes()

The IP address (IPv4 or IPv6) of the origin server that the request was sent to.

string server_ip = 13;

Returns
Type Description
ByteString

The bytes for serverIp.

getStatus()

public int getStatus()

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

int32 status = 4;

Returns
Type Description
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
Type Description
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
Type Description
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
Type Description
boolean

Whether the latency field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(HttpRequest other)

public HttpRequest.Builder mergeFrom(HttpRequest other)
Parameter
Name Description
other HttpRequest
Returns
Type Description
HttpRequest.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public HttpRequest.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
HttpRequest.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public HttpRequest.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
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
Name Description
value Duration
Returns
Type Description
HttpRequest.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final HttpRequest.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
value long

The cacheFillBytes to set.

Returns
Type Description
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
Name Description
value boolean

The cacheHit to set.

Returns
Type Description
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
Name Description
value boolean

The cacheLookup to set.

Returns
Type Description
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
Name Description
value boolean

The cacheValidatedWithOriginServer to set.

Returns
Type Description
HttpRequest.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public HttpRequest.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
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
Name Description
value Duration
Returns
Type Description
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
Name Description
builderForValue Builder
Returns
Type Description
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
Name Description
value String

The protocol to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for protocol to set.

Returns
Type Description
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
Name Description
value String

The referer to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for referer to set.

Returns
Type Description
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. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

string remote_ip = 7;

Parameter
Name Description
value String

The remoteIp to set.

Returns
Type Description
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. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329".

string remote_ip = 7;

Parameter
Name Description
value ByteString

The bytes for remoteIp to set.

Returns
Type Description
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
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
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
Name Description
value String

The requestMethod to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for requestMethod to set.

Returns
Type Description
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
Name Description
value long

The requestSize to set.

Returns
Type Description
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
Name Description
value String

The requestUrl to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for requestUrl to set.

Returns
Type Description
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
Name Description
value long

The responseSize to set.

Returns
Type Description
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.

string server_ip = 13;

Parameter
Name Description
value String

The serverIp to set.

Returns
Type Description
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.

string server_ip = 13;

Parameter
Name Description
value ByteString

The bytes for serverIp to set.

Returns
Type Description
HttpRequest.Builder

This builder for chaining.

setStatus(int value)

public HttpRequest.Builder setStatus(int value)

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

int32 status = 4;

Parameter
Name Description
value int

The status to set.

Returns
Type Description
HttpRequest.Builder

This builder for chaining.

setUnknownFields(UnknownFieldSet unknownFields)

public final HttpRequest.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
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
Name Description
value String

The userAgent to set.

Returns
Type Description
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
Name Description
value ByteString

The bytes for userAgent to set.

Returns
Type Description
HttpRequest.Builder

This builder for chaining.