Class HttpRequest

  • All Implemented Interfaces:
    HttpRequestOrBuilder, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>, com.google.protobuf.Message, com.google.protobuf.MessageLite, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.io.Serializable

    public final class HttpRequest
    extends com.google.protobuf.GeneratedMessageV3
    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
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  HttpRequest.Builder
      A common proto for logging HTTP requests.
      • Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3

        com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,​BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT,​BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter
      • Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage.ExtendableMessage

        com.google.protobuf.GeneratedMessage.ExtendableMessage.ExtensionSerializer, com.google.protobuf.GeneratedMessage.ExtendableMessage.ExtensionWriter
      • Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessage

        com.google.protobuf.GeneratedMessage.GeneratedExtension<ContainingT extends com.google.protobuf.Message,​T extends java.lang.Object>
      • Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite

        com.google.protobuf.AbstractMessageLite.InternalOneOfEnum
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      long getCacheFillBytes()
      The number of HTTP response bytes inserted into cache.
      boolean getCacheHit()
      Whether or not an entity was served from cache (with or without validation).
      boolean getCacheLookup()
      Whether or not a cache lookup was attempted.
      boolean getCacheValidatedWithOriginServer()
      Whether or not the response was validated with the origin server before being served from cache.
      static HttpRequest getDefaultInstance()  
      HttpRequest getDefaultInstanceForType()  
      static com.google.protobuf.Descriptors.Descriptor getDescriptor()  
      com.google.protobuf.Duration getLatency()
      The request processing latency on the server, from the time the request was received until the response was sent.
      com.google.protobuf.DurationOrBuilder getLatencyOrBuilder()
      The request processing latency on the server, from the time the request was received until the response was sent.
      com.google.protobuf.Parser<HttpRequest> getParserForType()  
      java.lang.String getProtocol()
      Protocol used for the request.
      com.google.protobuf.ByteString getProtocolBytes()
      Protocol used for the request.
      java.lang.String getReferer()
      The referer URL of the request, as defined in [HTTP/1.1 Header Field Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
      com.google.protobuf.ByteString getRefererBytes()
      The referer URL of the request, as defined in [HTTP/1.1 Header Field Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
      java.lang.String getRemoteIp()
      The IP address (IPv4 or IPv6) of the client that issued the HTTP request.
      com.google.protobuf.ByteString getRemoteIpBytes()
      The IP address (IPv4 or IPv6) of the client that issued the HTTP request.
      java.lang.String getRequestMethod()
      The request method.
      com.google.protobuf.ByteString getRequestMethodBytes()
      The request method.
      long getRequestSize()
      The size of the HTTP request message in bytes, including the request headers and the request body.
      java.lang.String getRequestUrl()
      The scheme (http, https), the host name, the path and the query portion of the URL that was requested.
      com.google.protobuf.ByteString getRequestUrlBytes()
      The scheme (http, https), the host name, the path and the query portion of the URL that was requested.
      long getResponseSize()
      The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.
      int getSerializedSize()  
      java.lang.String getServerIp()
      The IP address (IPv4 or IPv6) of the origin server that the request was sent to.
      com.google.protobuf.ByteString getServerIpBytes()
      The IP address (IPv4 or IPv6) of the origin server that the request was sent to.
      int getStatus()
      The response code indicating the status of response.
      java.lang.String getUserAgent()
      The user agent sent by the client.
      com.google.protobuf.ByteString getUserAgentBytes()
      The user agent sent by the client.
      int hashCode()  
      boolean hasLatency()
      The request processing latency on the server, from the time the request was received until the response was sent.
      protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()  
      boolean isInitialized()  
      static HttpRequest.Builder newBuilder()  
      static HttpRequest.Builder newBuilder​(HttpRequest prototype)  
      HttpRequest.Builder newBuilderForType()  
      protected HttpRequest.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)  
      protected java.lang.Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)  
      static HttpRequest parseDelimitedFrom​(java.io.InputStream input)  
      static HttpRequest parseDelimitedFrom​(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static HttpRequest parseFrom​(byte[] data)  
      static HttpRequest parseFrom​(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static HttpRequest parseFrom​(com.google.protobuf.ByteString data)  
      static HttpRequest parseFrom​(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static HttpRequest parseFrom​(com.google.protobuf.CodedInputStream input)  
      static HttpRequest parseFrom​(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static HttpRequest parseFrom​(java.io.InputStream input)  
      static HttpRequest parseFrom​(java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static HttpRequest parseFrom​(java.nio.ByteBuffer data)  
      static HttpRequest parseFrom​(java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)  
      static com.google.protobuf.Parser<HttpRequest> parser()  
      HttpRequest.Builder toBuilder()  
      void writeTo​(com.google.protobuf.CodedOutputStream output)  
      • Methods inherited from class com.google.protobuf.GeneratedMessageV3

        mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBuilderForType
      • Methods inherited from class com.google.protobuf.GeneratedMessage.ExtendableMessage

        extensionsAreInitialized, extensionsSerializedSize, extensionsSerializedSizeAsMessageSet, getAllFields, getAllFieldsRaw, getExtension, getExtension, getExtensionCount, getExtensionFields, getField, getRepeatedField, getRepeatedFieldCount, hasExtension, hasField, newExtensionSerializer, newExtensionWriter, newMessageSetExtensionSerializer, newMessageSetExtensionWriter
      • Methods inherited from class com.google.protobuf.GeneratedMessage

        canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getDescriptorForType, getOneofFieldDescriptor, getUnknownFields, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, newFileScopedGeneratedExtension, newInstance, newMessageScopedGeneratedExtension, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTag
      • Methods inherited from class com.google.protobuf.AbstractMessage

        findInitializationErrors, getInitializationErrorString, hashFields, toString
      • Methods inherited from class com.google.protobuf.AbstractMessageLite

        addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeTo
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface com.google.protobuf.MessageLite

        toByteArray, toByteString, writeDelimitedTo, writeTo
      • Methods inherited from interface com.google.protobuf.MessageOrBuilder

        findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
    • Method Detail

      • newInstance

        protected java.lang.Object newInstance​(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused)
        Overrides:
        newInstance in class com.google.protobuf.GeneratedMessageV3
      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Overrides:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3
      • getRequestMethod

        public java.lang.String getRequestMethod()
         The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
         
        string request_method = 1;
        Specified by:
        getRequestMethod in interface HttpRequestOrBuilder
        Returns:
        The requestMethod.
      • getRequestMethodBytes

        public com.google.protobuf.ByteString getRequestMethodBytes()
         The request method. Examples: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`.
         
        string request_method = 1;
        Specified by:
        getRequestMethodBytes in interface HttpRequestOrBuilder
        Returns:
        The bytes for requestMethod.
      • getRequestUrl

        public java.lang.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;
        Specified by:
        getRequestUrl in interface HttpRequestOrBuilder
        Returns:
        The requestUrl.
      • getRequestUrlBytes

        public com.google.protobuf.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;
        Specified by:
        getRequestUrlBytes in interface HttpRequestOrBuilder
        Returns:
        The bytes for requestUrl.
      • 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;
        Specified by:
        getRequestSize in interface HttpRequestOrBuilder
        Returns:
        The requestSize.
      • getStatus

        public int getStatus()
         The response code indicating the status of response.
         Examples: 200, 404.
         
        int32 status = 4;
        Specified by:
        getStatus in interface HttpRequestOrBuilder
        Returns:
        The status.
      • 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;
        Specified by:
        getResponseSize in interface HttpRequestOrBuilder
        Returns:
        The responseSize.
      • getUserAgent

        public java.lang.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;
        Specified by:
        getUserAgent in interface HttpRequestOrBuilder
        Returns:
        The userAgent.
      • getUserAgentBytes

        public com.google.protobuf.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;
        Specified by:
        getUserAgentBytes in interface HttpRequestOrBuilder
        Returns:
        The bytes for userAgent.
      • getRemoteIp

        public java.lang.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;
        Specified by:
        getRemoteIp in interface HttpRequestOrBuilder
        Returns:
        The remoteIp.
      • getRemoteIpBytes

        public com.google.protobuf.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;
        Specified by:
        getRemoteIpBytes in interface HttpRequestOrBuilder
        Returns:
        The bytes for remoteIp.
      • getServerIp

        public java.lang.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;
        Specified by:
        getServerIp in interface HttpRequestOrBuilder
        Returns:
        The serverIp.
      • getServerIpBytes

        public com.google.protobuf.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;
        Specified by:
        getServerIpBytes in interface HttpRequestOrBuilder
        Returns:
        The bytes for serverIp.
      • getReferer

        public java.lang.String getReferer()
         The referer URL of the request, as defined in
         [HTTP/1.1 Header Field
         Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
         
        string referer = 8;
        Specified by:
        getReferer in interface HttpRequestOrBuilder
        Returns:
        The referer.
      • getRefererBytes

        public com.google.protobuf.ByteString getRefererBytes()
         The referer URL of the request, as defined in
         [HTTP/1.1 Header Field
         Definitions](https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
         
        string referer = 8;
        Specified by:
        getRefererBytes in interface HttpRequestOrBuilder
        Returns:
        The bytes for referer.
      • 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;
        Specified by:
        hasLatency in interface HttpRequestOrBuilder
        Returns:
        Whether the latency field is set.
      • getLatency

        public com.google.protobuf.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;
        Specified by:
        getLatency in interface HttpRequestOrBuilder
        Returns:
        The latency.
      • getLatencyOrBuilder

        public com.google.protobuf.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;
        Specified by:
        getLatencyOrBuilder in interface HttpRequestOrBuilder
      • getCacheLookup

        public boolean getCacheLookup()
         Whether or not a cache lookup was attempted.
         
        bool cache_lookup = 11;
        Specified by:
        getCacheLookup in interface HttpRequestOrBuilder
        Returns:
        The cacheLookup.
      • getCacheHit

        public boolean getCacheHit()
         Whether or not an entity was served from cache
         (with or without validation).
         
        bool cache_hit = 9;
        Specified by:
        getCacheHit in interface HttpRequestOrBuilder
        Returns:
        The cacheHit.
      • 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;
        Specified by:
        getCacheValidatedWithOriginServer in interface HttpRequestOrBuilder
        Returns:
        The cacheValidatedWithOriginServer.
      • 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;
        Specified by:
        getCacheFillBytes in interface HttpRequestOrBuilder
        Returns:
        The cacheFillBytes.
      • getProtocol

        public java.lang.String getProtocol()
         Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
         
        string protocol = 15;
        Specified by:
        getProtocol in interface HttpRequestOrBuilder
        Returns:
        The protocol.
      • getProtocolBytes

        public com.google.protobuf.ByteString getProtocolBytes()
         Protocol used for the request. Examples: "HTTP/1.1", "HTTP/2", "websocket"
         
        string protocol = 15;
        Specified by:
        getProtocolBytes in interface HttpRequestOrBuilder
        Returns:
        The bytes for protocol.
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessage.ExtendableMessage<com.google.protobuf.GeneratedMessageV3>
      • writeTo

        public void writeTo​(com.google.protobuf.CodedOutputStream output)
                     throws java.io.IOException
        Specified by:
        writeTo in interface com.google.protobuf.MessageLite
        Overrides:
        writeTo in class com.google.protobuf.GeneratedMessage
        Throws:
        java.io.IOException
      • getSerializedSize

        public int getSerializedSize()
        Specified by:
        getSerializedSize in interface com.google.protobuf.MessageLite
        Overrides:
        getSerializedSize in class com.google.protobuf.GeneratedMessage
      • equals

        public boolean equals​(java.lang.Object obj)
        Specified by:
        equals in interface com.google.protobuf.Message
        Overrides:
        equals in class com.google.protobuf.AbstractMessage
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface com.google.protobuf.Message
        Overrides:
        hashCode in class com.google.protobuf.AbstractMessage
      • parseFrom

        public static HttpRequest parseFrom​(java.nio.ByteBuffer data)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpRequest parseFrom​(java.nio.ByteBuffer data,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpRequest parseFrom​(com.google.protobuf.ByteString data)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpRequest parseFrom​(com.google.protobuf.ByteString data,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpRequest parseFrom​(byte[] data)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpRequest parseFrom​(byte[] data,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws com.google.protobuf.InvalidProtocolBufferException
        Throws:
        com.google.protobuf.InvalidProtocolBufferException
      • parseFrom

        public static HttpRequest parseFrom​(java.io.InputStream input)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFrom

        public static HttpRequest parseFrom​(java.io.InputStream input,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • parseDelimitedFrom

        public static HttpRequest parseDelimitedFrom​(java.io.InputStream input)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • parseDelimitedFrom

        public static HttpRequest parseDelimitedFrom​(java.io.InputStream input,
                                                     com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                              throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFrom

        public static HttpRequest parseFrom​(com.google.protobuf.CodedInputStream input)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • parseFrom

        public static HttpRequest parseFrom​(com.google.protobuf.CodedInputStream input,
                                            com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                     throws java.io.IOException
        Throws:
        java.io.IOException
      • newBuilderForType

        public HttpRequest.Builder newBuilderForType()
        Specified by:
        newBuilderForType in interface com.google.protobuf.Message
        Specified by:
        newBuilderForType in interface com.google.protobuf.MessageLite
      • toBuilder

        public HttpRequest.Builder toBuilder()
        Specified by:
        toBuilder in interface com.google.protobuf.Message
        Specified by:
        toBuilder in interface com.google.protobuf.MessageLite
      • newBuilderForType

        protected HttpRequest.Builder newBuilderForType​(com.google.protobuf.GeneratedMessageV3.BuilderParent parent)
        Specified by:
        newBuilderForType in class com.google.protobuf.GeneratedMessageV3
      • getDefaultInstance

        public static HttpRequest getDefaultInstance()
      • parser

        public static com.google.protobuf.Parser<HttpRequest> parser()
      • getParserForType

        public com.google.protobuf.Parser<HttpRequest> getParserForType()
        Specified by:
        getParserForType in interface com.google.protobuf.Message
        Specified by:
        getParserForType in interface com.google.protobuf.MessageLite
        Overrides:
        getParserForType in class com.google.protobuf.GeneratedMessage
      • getDefaultInstanceForType

        public HttpRequest getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder