From d32428b1aef895721f38894f37baac0086357531 Mon Sep 17 00:00:00 2001 From: Wilson Kurniawan Date: Mon, 15 Feb 2021 22:56:40 +0800 Subject: [PATCH] [#10929] Migrate Task Queue API and Logs API to GCP clients (#10930) * Change taskqueue API to Cloud Tasks API * Add option to execute task queues immediately in dev server * Use Cloud Logging API to read logs * Add generated protobuf files for RequestLog * Enable request logs to be parsed and processed Co-authored-by: Ahmed Bahajjaj --- .codecov.yml | 3 + build.gradle | 7 +- .../google/appengine/logging/v1/LogLine.java | 1110 ++++ .../logging/v1/LogLineOrBuilder.java | 94 + .../appengine/logging/v1/RequestLog.java | 5783 +++++++++++++++++ .../logging/v1/RequestLogOrBuilder.java | 637 ++ .../appengine/logging/v1/RequestLogProto.java | 130 + .../appengine/logging/v1/SourceLocation.java | 813 +++ .../logging/v1/SourceLocationOrBuilder.java | 66 + .../appengine/logging/v1/SourceReference.java | 712 ++ .../logging/v1/SourceReferenceOrBuilder.java | 49 + .../java/teammates/common/util/Config.java | 8 + .../teammates/logic/api/EmailGenerator.java | 14 +- .../teammates/logic/core/TaskQueuesLogic.java | 113 +- .../ui/webapi/CompileLogsAction.java | 106 +- src/main/resources/build.template.properties | 10 + .../architecture/ArchitectureTest.java | 4 +- .../logic/api/EmailGeneratorTest.java | 18 +- .../java/teammates/test/GaeSimulation.java | 11 +- .../teammates-checkstyle-suppressions.xml | 3 + static-analysis/teammates-pmd.xml | 1 + static-analysis/teammates-pmdMain.xml | 1 + .../teammates-spotbugs-exclude.xml | 7 + 23 files changed, 9623 insertions(+), 77 deletions(-) create mode 100644 src/main/java/com/google/appengine/logging/v1/LogLine.java create mode 100644 src/main/java/com/google/appengine/logging/v1/LogLineOrBuilder.java create mode 100644 src/main/java/com/google/appengine/logging/v1/RequestLog.java create mode 100644 src/main/java/com/google/appengine/logging/v1/RequestLogOrBuilder.java create mode 100644 src/main/java/com/google/appengine/logging/v1/RequestLogProto.java create mode 100644 src/main/java/com/google/appengine/logging/v1/SourceLocation.java create mode 100644 src/main/java/com/google/appengine/logging/v1/SourceLocationOrBuilder.java create mode 100644 src/main/java/com/google/appengine/logging/v1/SourceReference.java create mode 100644 src/main/java/com/google/appengine/logging/v1/SourceReferenceOrBuilder.java create mode 100644 static-analysis/teammates-spotbugs-exclude.xml diff --git a/.codecov.yml b/.codecov.yml index 10b55278768..3193da9a9b4 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -25,3 +25,6 @@ coverage: default: # enforce manually; sometimes used codes are not "covered" e.g. client scripts threshold: 100% + +ignore: + - "src/main/java/com/google/appengine/logging/v1/*.java" diff --git a/build.gradle b/build.gradle index 93c7edd90f0..1eec9f64526 100644 --- a/build.gradle +++ b/build.gradle @@ -30,7 +30,7 @@ buildscript { classpath("cz.habarta.typescript-generator:typescript-generator-gradle-plugin:2.24.612") { exclude group: "org.gradle" } - classpath "com.google.guava:guava:29.0-jre" + classpath "com.google.guava:guava:30.1-jre" } } @@ -54,6 +54,8 @@ dependencies { annotationProcessor(objectify) implementation("com.google.appengine:appengine-api-1.0-sdk:${appengineVersion}") + implementation("com.google.cloud:google-cloud-tasks:1.30.11") + implementation("com.google.cloud:google-cloud-logging:2.1.2") // This dependency needs to be resolved individually // because the main dependency (appengine-gcs-client) does not have its transitive dependencies up-to-date @@ -68,7 +70,7 @@ dependencies { implementation("com.google.apis:google-api-services-storage:v1-rev20200430-1.30.9") implementation("com.google.code.gson:gson:2.8.6") - implementation("com.google.guava:guava:29.0-jre") + implementation("com.google.guava:guava:30.1-jre") implementation(objectify) implementation("com.googlecode.owasp-java-html-sanitizer:owasp-java-html-sanitizer:20200615.1") implementation("com.mailjet:mailjet-client:4.5.0") @@ -319,6 +321,7 @@ spotbugs { reportLevel = "low" toolVersion = spotbugsVersion includeFilter = file("$rootProject.projectDir/static-analysis/teammates-spotbugs.xml") + excludeFilter = file("$rootProject.projectDir/static-analysis/teammates-spotbugs-exclude.xml") } tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { diff --git a/src/main/java/com/google/appengine/logging/v1/LogLine.java b/src/main/java/com/google/appengine/logging/v1/LogLine.java new file mode 100644 index 00000000000..47b6007a3ee --- /dev/null +++ b/src/main/java/com/google/appengine/logging/v1/LogLine.java @@ -0,0 +1,1110 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/appengine/logging/v1/request_log.proto + +package com.google.appengine.logging.v1; + +/** + *
+ * Application log line emitted while processing a request.
+ * 
+ * + * Protobuf type {@code google.appengine.logging.v1.LogLine} + */ +public final class LogLine extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.appengine.logging.v1.LogLine) + LogLineOrBuilder { + // Use LogLine.newBuilder() to construct. + private LogLine(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private LogLine() { + severity_ = 0; + logMessage_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private LogLine( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (time_ != null) { + subBuilder = time_.toBuilder(); + } + time_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(time_); + time_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + int rawValue = input.readEnum(); + + severity_ = rawValue; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + logMessage_ = s; + break; + } + case 34: { + com.google.appengine.logging.v1.SourceLocation.Builder subBuilder = null; + if (sourceLocation_ != null) { + subBuilder = sourceLocation_.toBuilder(); + } + sourceLocation_ = input.readMessage(com.google.appengine.logging.v1.SourceLocation.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(sourceLocation_); + sourceLocation_ = subBuilder.buildPartial(); + } + + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_LogLine_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_LogLine_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.appengine.logging.v1.LogLine.class, com.google.appengine.logging.v1.LogLine.Builder.class); + } + + public static final int TIME_FIELD_NUMBER = 1; + private com.google.protobuf.Timestamp time_; + /** + *
+   * Approximate time when this log entry was made.
+   * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public boolean hasTime() { + return time_ != null; + } + /** + *
+   * Approximate time when this log entry was made.
+   * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public com.google.protobuf.Timestamp getTime() { + return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_; + } + /** + *
+   * Approximate time when this log entry was made.
+   * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { + return getTime(); + } + + public static final int SEVERITY_FIELD_NUMBER = 2; + private int severity_; + /** + *
+   * Severity of this log entry.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 2; + */ + public int getSeverityValue() { + return severity_; + } + /** + *
+   * Severity of this log entry.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 2; + */ + public com.google.logging.type.LogSeverity getSeverity() { + com.google.logging.type.LogSeverity result = com.google.logging.type.LogSeverity.valueOf(severity_); + return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result; + } + + public static final int LOG_MESSAGE_FIELD_NUMBER = 3; + private volatile java.lang.Object logMessage_; + /** + *
+   * App-provided log message.
+   * 
+ * + * string log_message = 3; + */ + public java.lang.String getLogMessage() { + java.lang.Object ref = logMessage_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logMessage_ = s; + return s; + } + } + /** + *
+   * App-provided log message.
+   * 
+ * + * string log_message = 3; + */ + public com.google.protobuf.ByteString + getLogMessageBytes() { + java.lang.Object ref = logMessage_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_LOCATION_FIELD_NUMBER = 4; + private com.google.appengine.logging.v1.SourceLocation sourceLocation_; + /** + *
+   * Where in the source code this log message was written.
+   * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public boolean hasSourceLocation() { + return sourceLocation_ != null; + } + /** + *
+   * Where in the source code this log message was written.
+   * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public com.google.appengine.logging.v1.SourceLocation getSourceLocation() { + return sourceLocation_ == null ? com.google.appengine.logging.v1.SourceLocation.getDefaultInstance() : sourceLocation_; + } + /** + *
+   * Where in the source code this log message was written.
+   * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public com.google.appengine.logging.v1.SourceLocationOrBuilder getSourceLocationOrBuilder() { + return getSourceLocation(); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (time_ != null) { + output.writeMessage(1, getTime()); + } + if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) { + output.writeEnum(2, severity_); + } + if (!getLogMessageBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, logMessage_); + } + if (sourceLocation_ != null) { + output.writeMessage(4, getSourceLocation()); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (time_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getTime()); + } + if (severity_ != com.google.logging.type.LogSeverity.DEFAULT.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, severity_); + } + if (!getLogMessageBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, logMessage_); + } + if (sourceLocation_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getSourceLocation()); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.appengine.logging.v1.LogLine)) { + return super.equals(obj); + } + com.google.appengine.logging.v1.LogLine other = (com.google.appengine.logging.v1.LogLine) obj; + + boolean result = true; + result = result && (hasTime() == other.hasTime()); + if (hasTime()) { + result = result && getTime() + .equals(other.getTime()); + } + result = result && severity_ == other.severity_; + result = result && getLogMessage() + .equals(other.getLogMessage()); + result = result && (hasSourceLocation() == other.hasSourceLocation()); + if (hasSourceLocation()) { + result = result && getSourceLocation() + .equals(other.getSourceLocation()); + } + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasTime()) { + hash = (37 * hash) + TIME_FIELD_NUMBER; + hash = (53 * hash) + getTime().hashCode(); + } + hash = (37 * hash) + SEVERITY_FIELD_NUMBER; + hash = (53 * hash) + severity_; + hash = (37 * hash) + LOG_MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getLogMessage().hashCode(); + if (hasSourceLocation()) { + hash = (37 * hash) + SOURCE_LOCATION_FIELD_NUMBER; + hash = (53 * hash) + getSourceLocation().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.appengine.logging.v1.LogLine parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.LogLine parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.LogLine parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.LogLine parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.LogLine parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.LogLine parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.LogLine parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.LogLine parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.appengine.logging.v1.LogLine parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.LogLine parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.appengine.logging.v1.LogLine parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.LogLine parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.appengine.logging.v1.LogLine prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Application log line emitted while processing a request.
+   * 
+ * + * Protobuf type {@code google.appengine.logging.v1.LogLine} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.appengine.logging.v1.LogLine) + com.google.appengine.logging.v1.LogLineOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_LogLine_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_LogLine_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.appengine.logging.v1.LogLine.class, com.google.appengine.logging.v1.LogLine.Builder.class); + } + + // Construct using com.google.appengine.logging.v1.LogLine.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + if (timeBuilder_ == null) { + time_ = null; + } else { + time_ = null; + timeBuilder_ = null; + } + severity_ = 0; + + logMessage_ = ""; + + if (sourceLocationBuilder_ == null) { + sourceLocation_ = null; + } else { + sourceLocation_ = null; + sourceLocationBuilder_ = null; + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_LogLine_descriptor; + } + + public com.google.appengine.logging.v1.LogLine getDefaultInstanceForType() { + return com.google.appengine.logging.v1.LogLine.getDefaultInstance(); + } + + public com.google.appengine.logging.v1.LogLine build() { + com.google.appengine.logging.v1.LogLine result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.appengine.logging.v1.LogLine buildPartial() { + com.google.appengine.logging.v1.LogLine result = new com.google.appengine.logging.v1.LogLine(this); + if (timeBuilder_ == null) { + result.time_ = time_; + } else { + result.time_ = timeBuilder_.build(); + } + result.severity_ = severity_; + result.logMessage_ = logMessage_; + if (sourceLocationBuilder_ == null) { + result.sourceLocation_ = sourceLocation_; + } else { + result.sourceLocation_ = sourceLocationBuilder_.build(); + } + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.appengine.logging.v1.LogLine) { + return mergeFrom((com.google.appengine.logging.v1.LogLine)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.appengine.logging.v1.LogLine other) { + if (other == com.google.appengine.logging.v1.LogLine.getDefaultInstance()) return this; + if (other.hasTime()) { + mergeTime(other.getTime()); + } + if (other.severity_ != 0) { + setSeverityValue(other.getSeverityValue()); + } + if (!other.getLogMessage().isEmpty()) { + logMessage_ = other.logMessage_; + onChanged(); + } + if (other.hasSourceLocation()) { + mergeSourceLocation(other.getSourceLocation()); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.appengine.logging.v1.LogLine parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.appengine.logging.v1.LogLine) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Timestamp time_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> timeBuilder_; + /** + *
+     * Approximate time when this log entry was made.
+     * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public boolean hasTime() { + return timeBuilder_ != null || time_ != null; + } + /** + *
+     * Approximate time when this log entry was made.
+     * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public com.google.protobuf.Timestamp getTime() { + if (timeBuilder_ == null) { + return time_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : time_; + } else { + return timeBuilder_.getMessage(); + } + } + /** + *
+     * Approximate time when this log entry was made.
+     * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public Builder setTime(com.google.protobuf.Timestamp value) { + if (timeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + time_ = value; + onChanged(); + } else { + timeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Approximate time when this log entry was made.
+     * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public Builder setTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (timeBuilder_ == null) { + time_ = builderForValue.build(); + onChanged(); + } else { + timeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Approximate time when this log entry was made.
+     * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public Builder mergeTime(com.google.protobuf.Timestamp value) { + if (timeBuilder_ == null) { + if (time_ != null) { + time_ = + com.google.protobuf.Timestamp.newBuilder(time_).mergeFrom(value).buildPartial(); + } else { + time_ = value; + } + onChanged(); + } else { + timeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Approximate time when this log entry was made.
+     * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public Builder clearTime() { + if (timeBuilder_ == null) { + time_ = null; + onChanged(); + } else { + time_ = null; + timeBuilder_ = null; + } + + return this; + } + /** + *
+     * Approximate time when this log entry was made.
+     * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public com.google.protobuf.Timestamp.Builder getTimeBuilder() { + + onChanged(); + return getTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Approximate time when this log entry was made.
+     * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + public com.google.protobuf.TimestampOrBuilder getTimeOrBuilder() { + if (timeBuilder_ != null) { + return timeBuilder_.getMessageOrBuilder(); + } else { + return time_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : time_; + } + } + /** + *
+     * Approximate time when this log entry was made.
+     * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getTimeFieldBuilder() { + if (timeBuilder_ == null) { + timeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getTime(), + getParentForChildren(), + isClean()); + time_ = null; + } + return timeBuilder_; + } + + private int severity_ = 0; + /** + *
+     * Severity of this log entry.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 2; + */ + public int getSeverityValue() { + return severity_; + } + /** + *
+     * Severity of this log entry.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 2; + */ + public Builder setSeverityValue(int value) { + severity_ = value; + onChanged(); + return this; + } + /** + *
+     * Severity of this log entry.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 2; + */ + public com.google.logging.type.LogSeverity getSeverity() { + com.google.logging.type.LogSeverity result = com.google.logging.type.LogSeverity.valueOf(severity_); + return result == null ? com.google.logging.type.LogSeverity.UNRECOGNIZED : result; + } + /** + *
+     * Severity of this log entry.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 2; + */ + public Builder setSeverity(com.google.logging.type.LogSeverity value) { + if (value == null) { + throw new NullPointerException(); + } + + severity_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+     * Severity of this log entry.
+     * 
+ * + * .google.logging.type.LogSeverity severity = 2; + */ + public Builder clearSeverity() { + + severity_ = 0; + onChanged(); + return this; + } + + private java.lang.Object logMessage_ = ""; + /** + *
+     * App-provided log message.
+     * 
+ * + * string log_message = 3; + */ + public java.lang.String getLogMessage() { + java.lang.Object ref = logMessage_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + logMessage_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * App-provided log message.
+     * 
+ * + * string log_message = 3; + */ + public com.google.protobuf.ByteString + getLogMessageBytes() { + java.lang.Object ref = logMessage_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + logMessage_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * App-provided log message.
+     * 
+ * + * string log_message = 3; + */ + public Builder setLogMessage( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + logMessage_ = value; + onChanged(); + return this; + } + /** + *
+     * App-provided log message.
+     * 
+ * + * string log_message = 3; + */ + public Builder clearLogMessage() { + + logMessage_ = getDefaultInstance().getLogMessage(); + onChanged(); + return this; + } + /** + *
+     * App-provided log message.
+     * 
+ * + * string log_message = 3; + */ + public Builder setLogMessageBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + logMessage_ = value; + onChanged(); + return this; + } + + private com.google.appengine.logging.v1.SourceLocation sourceLocation_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.appengine.logging.v1.SourceLocation, com.google.appengine.logging.v1.SourceLocation.Builder, com.google.appengine.logging.v1.SourceLocationOrBuilder> sourceLocationBuilder_; + /** + *
+     * Where in the source code this log message was written.
+     * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public boolean hasSourceLocation() { + return sourceLocationBuilder_ != null || sourceLocation_ != null; + } + /** + *
+     * Where in the source code this log message was written.
+     * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public com.google.appengine.logging.v1.SourceLocation getSourceLocation() { + if (sourceLocationBuilder_ == null) { + return sourceLocation_ == null ? com.google.appengine.logging.v1.SourceLocation.getDefaultInstance() : sourceLocation_; + } else { + return sourceLocationBuilder_.getMessage(); + } + } + /** + *
+     * Where in the source code this log message was written.
+     * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public Builder setSourceLocation(com.google.appengine.logging.v1.SourceLocation value) { + if (sourceLocationBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + sourceLocation_ = value; + onChanged(); + } else { + sourceLocationBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Where in the source code this log message was written.
+     * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public Builder setSourceLocation( + com.google.appengine.logging.v1.SourceLocation.Builder builderForValue) { + if (sourceLocationBuilder_ == null) { + sourceLocation_ = builderForValue.build(); + onChanged(); + } else { + sourceLocationBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Where in the source code this log message was written.
+     * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public Builder mergeSourceLocation(com.google.appengine.logging.v1.SourceLocation value) { + if (sourceLocationBuilder_ == null) { + if (sourceLocation_ != null) { + sourceLocation_ = + com.google.appengine.logging.v1.SourceLocation.newBuilder(sourceLocation_).mergeFrom(value).buildPartial(); + } else { + sourceLocation_ = value; + } + onChanged(); + } else { + sourceLocationBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Where in the source code this log message was written.
+     * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public Builder clearSourceLocation() { + if (sourceLocationBuilder_ == null) { + sourceLocation_ = null; + onChanged(); + } else { + sourceLocation_ = null; + sourceLocationBuilder_ = null; + } + + return this; + } + /** + *
+     * Where in the source code this log message was written.
+     * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public com.google.appengine.logging.v1.SourceLocation.Builder getSourceLocationBuilder() { + + onChanged(); + return getSourceLocationFieldBuilder().getBuilder(); + } + /** + *
+     * Where in the source code this log message was written.
+     * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + public com.google.appengine.logging.v1.SourceLocationOrBuilder getSourceLocationOrBuilder() { + if (sourceLocationBuilder_ != null) { + return sourceLocationBuilder_.getMessageOrBuilder(); + } else { + return sourceLocation_ == null ? + com.google.appengine.logging.v1.SourceLocation.getDefaultInstance() : sourceLocation_; + } + } + /** + *
+     * Where in the source code this log message was written.
+     * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.appengine.logging.v1.SourceLocation, com.google.appengine.logging.v1.SourceLocation.Builder, com.google.appengine.logging.v1.SourceLocationOrBuilder> + getSourceLocationFieldBuilder() { + if (sourceLocationBuilder_ == null) { + sourceLocationBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.appengine.logging.v1.SourceLocation, com.google.appengine.logging.v1.SourceLocation.Builder, com.google.appengine.logging.v1.SourceLocationOrBuilder>( + getSourceLocation(), + getParentForChildren(), + isClean()); + sourceLocation_ = null; + } + return sourceLocationBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.appengine.logging.v1.LogLine) + } + + // @@protoc_insertion_point(class_scope:google.appengine.logging.v1.LogLine) + private static final com.google.appengine.logging.v1.LogLine DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.appengine.logging.v1.LogLine(); + } + + public static com.google.appengine.logging.v1.LogLine getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public LogLine parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new LogLine(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.appengine.logging.v1.LogLine getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/appengine/logging/v1/LogLineOrBuilder.java b/src/main/java/com/google/appengine/logging/v1/LogLineOrBuilder.java new file mode 100644 index 00000000000..14121e541bb --- /dev/null +++ b/src/main/java/com/google/appengine/logging/v1/LogLineOrBuilder.java @@ -0,0 +1,94 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/appengine/logging/v1/request_log.proto + +package com.google.appengine.logging.v1; + +public interface LogLineOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.appengine.logging.v1.LogLine) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Approximate time when this log entry was made.
+   * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + boolean hasTime(); + /** + *
+   * Approximate time when this log entry was made.
+   * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + com.google.protobuf.Timestamp getTime(); + /** + *
+   * Approximate time when this log entry was made.
+   * 
+ * + * .google.protobuf.Timestamp time = 1; + */ + com.google.protobuf.TimestampOrBuilder getTimeOrBuilder(); + + /** + *
+   * Severity of this log entry.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 2; + */ + int getSeverityValue(); + /** + *
+   * Severity of this log entry.
+   * 
+ * + * .google.logging.type.LogSeverity severity = 2; + */ + com.google.logging.type.LogSeverity getSeverity(); + + /** + *
+   * App-provided log message.
+   * 
+ * + * string log_message = 3; + */ + java.lang.String getLogMessage(); + /** + *
+   * App-provided log message.
+   * 
+ * + * string log_message = 3; + */ + com.google.protobuf.ByteString + getLogMessageBytes(); + + /** + *
+   * Where in the source code this log message was written.
+   * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + boolean hasSourceLocation(); + /** + *
+   * Where in the source code this log message was written.
+   * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + com.google.appengine.logging.v1.SourceLocation getSourceLocation(); + /** + *
+   * Where in the source code this log message was written.
+   * 
+ * + * .google.appengine.logging.v1.SourceLocation source_location = 4; + */ + com.google.appengine.logging.v1.SourceLocationOrBuilder getSourceLocationOrBuilder(); +} diff --git a/src/main/java/com/google/appengine/logging/v1/RequestLog.java b/src/main/java/com/google/appengine/logging/v1/RequestLog.java new file mode 100644 index 00000000000..b99e7d1a5cb --- /dev/null +++ b/src/main/java/com/google/appengine/logging/v1/RequestLog.java @@ -0,0 +1,5783 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/appengine/logging/v1/request_log.proto + +package com.google.appengine.logging.v1; + +/** + *
+ * Complete log information about a single HTTP request to an App Engine
+ * application.
+ * 
+ * + * Protobuf type {@code google.appengine.logging.v1.RequestLog} + */ +public final class RequestLog extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.appengine.logging.v1.RequestLog) + RequestLogOrBuilder { + // Use RequestLog.newBuilder() to construct. + private RequestLog(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private RequestLog() { + appId_ = ""; + moduleId_ = ""; + versionId_ = ""; + requestId_ = ""; + ip_ = ""; + megaCycles_ = 0L; + method_ = ""; + resource_ = ""; + httpVersion_ = ""; + status_ = 0; + responseSize_ = 0L; + referrer_ = ""; + userAgent_ = ""; + nickname_ = ""; + urlMapEntry_ = ""; + host_ = ""; + cost_ = 0D; + taskQueueName_ = ""; + taskName_ = ""; + wasLoadingRequest_ = false; + instanceIndex_ = 0; + finished_ = false; + first_ = false; + instanceId_ = ""; + line_ = java.util.Collections.emptyList(); + appEngineRelease_ = ""; + traceId_ = ""; + traceSampled_ = false; + sourceReference_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private RequestLog( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + int mutable_bitField1_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + appId_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + versionId_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + requestId_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + ip_ = s; + break; + } + case 50: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (startTime_ != null) { + subBuilder = startTime_.toBuilder(); + } + startTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(startTime_); + startTime_ = subBuilder.buildPartial(); + } + + break; + } + case 58: { + com.google.protobuf.Timestamp.Builder subBuilder = null; + if (endTime_ != null) { + subBuilder = endTime_.toBuilder(); + } + endTime_ = input.readMessage(com.google.protobuf.Timestamp.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(endTime_); + endTime_ = subBuilder.buildPartial(); + } + + break; + } + case 66: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (latency_ != null) { + subBuilder = latency_.toBuilder(); + } + latency_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(latency_); + latency_ = subBuilder.buildPartial(); + } + + break; + } + case 72: { + + megaCycles_ = input.readInt64(); + break; + } + case 82: { + java.lang.String s = input.readStringRequireUtf8(); + + method_ = s; + break; + } + case 90: { + java.lang.String s = input.readStringRequireUtf8(); + + resource_ = s; + break; + } + case 98: { + java.lang.String s = input.readStringRequireUtf8(); + + httpVersion_ = s; + break; + } + case 104: { + + status_ = input.readInt32(); + break; + } + case 112: { + + responseSize_ = input.readInt64(); + break; + } + case 122: { + java.lang.String s = input.readStringRequireUtf8(); + + referrer_ = s; + break; + } + case 130: { + java.lang.String s = input.readStringRequireUtf8(); + + userAgent_ = s; + break; + } + case 138: { + java.lang.String s = input.readStringRequireUtf8(); + + urlMapEntry_ = s; + break; + } + case 162: { + java.lang.String s = input.readStringRequireUtf8(); + + host_ = s; + break; + } + case 169: { + + cost_ = input.readDouble(); + break; + } + case 178: { + java.lang.String s = input.readStringRequireUtf8(); + + taskQueueName_ = s; + break; + } + case 186: { + java.lang.String s = input.readStringRequireUtf8(); + + taskName_ = s; + break; + } + case 192: { + + wasLoadingRequest_ = input.readBool(); + break; + } + case 202: { + com.google.protobuf.Duration.Builder subBuilder = null; + if (pendingTime_ != null) { + subBuilder = pendingTime_.toBuilder(); + } + pendingTime_ = input.readMessage(com.google.protobuf.Duration.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(pendingTime_); + pendingTime_ = subBuilder.buildPartial(); + } + + break; + } + case 208: { + + instanceIndex_ = input.readInt32(); + break; + } + case 216: { + + finished_ = input.readBool(); + break; + } + case 226: { + java.lang.String s = input.readStringRequireUtf8(); + + instanceId_ = s; + break; + } + case 234: { + if (!((mutable_bitField0_ & 0x10000000) == 0x10000000)) { + line_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x10000000; + } + line_.add( + input.readMessage(com.google.appengine.logging.v1.LogLine.parser(), extensionRegistry)); + break; + } + case 298: { + java.lang.String s = input.readStringRequireUtf8(); + + moduleId_ = s; + break; + } + case 306: { + java.lang.String s = input.readStringRequireUtf8(); + + appEngineRelease_ = s; + break; + } + case 314: { + java.lang.String s = input.readStringRequireUtf8(); + + traceId_ = s; + break; + } + case 322: { + java.lang.String s = input.readStringRequireUtf8(); + + nickname_ = s; + break; + } + case 330: { + if (!((mutable_bitField1_ & 0x00000001) == 0x00000001)) { + sourceReference_ = new java.util.ArrayList(); + mutable_bitField1_ |= 0x00000001; + } + sourceReference_.add( + input.readMessage(com.google.appengine.logging.v1.SourceReference.parser(), extensionRegistry)); + break; + } + case 336: { + + first_ = input.readBool(); + break; + } + case 344: { + + traceSampled_ = input.readBool(); + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x10000000) == 0x10000000)) { + line_ = java.util.Collections.unmodifiableList(line_); + } + if (((mutable_bitField1_ & 0x00000001) == 0x00000001)) { + sourceReference_ = java.util.Collections.unmodifiableList(sourceReference_); + } + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_RequestLog_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_RequestLog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.appengine.logging.v1.RequestLog.class, com.google.appengine.logging.v1.RequestLog.Builder.class); + } + + private int bitField0_; + public static final int APP_ID_FIELD_NUMBER = 1; + private volatile java.lang.Object appId_; + /** + *
+   * Application that handled this request.
+   * 
+ * + * string app_id = 1; + */ + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } + } + /** + *
+   * Application that handled this request.
+   * 
+ * + * string app_id = 1; + */ + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MODULE_ID_FIELD_NUMBER = 37; + private volatile java.lang.Object moduleId_; + /** + *
+   * Module of the application that handled this request.
+   * 
+ * + * string module_id = 37; + */ + public java.lang.String getModuleId() { + java.lang.Object ref = moduleId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + moduleId_ = s; + return s; + } + } + /** + *
+   * Module of the application that handled this request.
+   * 
+ * + * string module_id = 37; + */ + public com.google.protobuf.ByteString + getModuleIdBytes() { + java.lang.Object ref = moduleId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + moduleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VERSION_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object versionId_; + /** + *
+   * Version of the application that handled this request.
+   * 
+ * + * string version_id = 2; + */ + public java.lang.String getVersionId() { + java.lang.Object ref = versionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + versionId_ = s; + return s; + } + } + /** + *
+   * Version of the application that handled this request.
+   * 
+ * + * string version_id = 2; + */ + public com.google.protobuf.ByteString + getVersionIdBytes() { + java.lang.Object ref = versionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + versionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_ID_FIELD_NUMBER = 3; + private volatile java.lang.Object requestId_; + /** + *
+   * Globally unique identifier for a request, which is based on the request
+   * start time.  Request IDs for requests which started later will compare
+   * greater as strings than those for requests which started earlier.
+   * 
+ * + * string request_id = 3; + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } + } + /** + *
+   * Globally unique identifier for a request, which is based on the request
+   * start time.  Request IDs for requests which started later will compare
+   * greater as strings than those for requests which started earlier.
+   * 
+ * + * string request_id = 3; + */ + public com.google.protobuf.ByteString + getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IP_FIELD_NUMBER = 4; + private volatile java.lang.Object ip_; + /** + *
+   * Origin IP address.
+   * 
+ * + * string ip = 4; + */ + public java.lang.String getIp() { + java.lang.Object ref = ip_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ip_ = s; + return s; + } + } + /** + *
+   * Origin IP address.
+   * 
+ * + * string ip = 4; + */ + public com.google.protobuf.ByteString + getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int START_TIME_FIELD_NUMBER = 6; + private com.google.protobuf.Timestamp startTime_; + /** + *
+   * Time when the request started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public boolean hasStartTime() { + return startTime_ != null; + } + /** + *
+   * Time when the request started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.Timestamp getStartTime() { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + /** + *
+   * Time when the request started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + return getStartTime(); + } + + public static final int END_TIME_FIELD_NUMBER = 7; + private com.google.protobuf.Timestamp endTime_; + /** + *
+   * Time when the request finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public boolean hasEndTime() { + return endTime_ != null; + } + /** + *
+   * Time when the request finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.Timestamp getEndTime() { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + /** + *
+   * Time when the request finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + return getEndTime(); + } + + public static final int LATENCY_FIELD_NUMBER = 8; + private com.google.protobuf.Duration latency_; + /** + *
+   * Latency of the request.
+   * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public boolean hasLatency() { + return latency_ != null; + } + /** + *
+   * Latency of the request.
+   * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public com.google.protobuf.Duration getLatency() { + return latency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : latency_; + } + /** + *
+   * Latency of the request.
+   * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public com.google.protobuf.DurationOrBuilder getLatencyOrBuilder() { + return getLatency(); + } + + public static final int MEGA_CYCLES_FIELD_NUMBER = 9; + private long megaCycles_; + /** + *
+   * Number of CPU megacycles used to process request.
+   * 
+ * + * int64 mega_cycles = 9; + */ + public long getMegaCycles() { + return megaCycles_; + } + + public static final int METHOD_FIELD_NUMBER = 10; + private volatile java.lang.Object method_; + /** + *
+   * Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
+   * 
+ * + * string method = 10; + */ + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } + } + /** + *
+   * Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
+   * 
+ * + * string method = 10; + */ + public com.google.protobuf.ByteString + getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_FIELD_NUMBER = 11; + private volatile java.lang.Object resource_; + /** + *
+   * Contains the path and query portion of the URL that was requested. For
+   * example, if the URL was "http://example.com/app?name=val", the resource
+   * would be "/app?name=val".  The fragment identifier, which is identified by
+   * the `#` character, is not included.
+   * 
+ * + * string resource = 11; + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } + } + /** + *
+   * Contains the path and query portion of the URL that was requested. For
+   * example, if the URL was "http://example.com/app?name=val", the resource
+   * would be "/app?name=val".  The fragment identifier, which is identified by
+   * the `#` character, is not included.
+   * 
+ * + * string resource = 11; + */ + public com.google.protobuf.ByteString + getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HTTP_VERSION_FIELD_NUMBER = 12; + private volatile java.lang.Object httpVersion_; + /** + *
+   * HTTP version of request. Example: `"HTTP/1.1"`.
+   * 
+ * + * string http_version = 12; + */ + public java.lang.String getHttpVersion() { + java.lang.Object ref = httpVersion_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + httpVersion_ = s; + return s; + } + } + /** + *
+   * HTTP version of request. Example: `"HTTP/1.1"`.
+   * 
+ * + * string http_version = 12; + */ + public com.google.protobuf.ByteString + getHttpVersionBytes() { + java.lang.Object ref = httpVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + httpVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATUS_FIELD_NUMBER = 13; + private int status_; + /** + *
+   * HTTP response status code. Example: 200, 404.
+   * 
+ * + * int32 status = 13; + */ + public int getStatus() { + return status_; + } + + public static final int RESPONSE_SIZE_FIELD_NUMBER = 14; + private long responseSize_; + /** + *
+   * Size in bytes sent back to client by request.
+   * 
+ * + * int64 response_size = 14; + */ + public long getResponseSize() { + return responseSize_; + } + + public static final int REFERRER_FIELD_NUMBER = 15; + private volatile java.lang.Object referrer_; + /** + *
+   * Referrer URL of request.
+   * 
+ * + * string referrer = 15; + */ + public java.lang.String getReferrer() { + java.lang.Object ref = referrer_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referrer_ = s; + return s; + } + } + /** + *
+   * Referrer URL of request.
+   * 
+ * + * string referrer = 15; + */ + public com.google.protobuf.ByteString + getReferrerBytes() { + java.lang.Object ref = referrer_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + referrer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USER_AGENT_FIELD_NUMBER = 16; + private volatile java.lang.Object userAgent_; + /** + *
+   * User agent that made the request.
+   * 
+ * + * string user_agent = 16; + */ + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userAgent_ = s; + return s; + } + } + /** + *
+   * User agent that made the request.
+   * 
+ * + * string user_agent = 16; + */ + public com.google.protobuf.ByteString + getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NICKNAME_FIELD_NUMBER = 40; + private volatile java.lang.Object nickname_; + /** + *
+   * The logged-in user who made the request.
+   * Most likely, this is the part of the user's email before the `@` sign.  The
+   * field value is the same for different requests from the same user, but
+   * different users can have similar names.  This information is also
+   * available to the application via the App Engine Users API.
+   * This field will be populated starting with App Engine 1.9.21.
+   * 
+ * + * string nickname = 40; + */ + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nickname_ = s; + return s; + } + } + /** + *
+   * The logged-in user who made the request.
+   * Most likely, this is the part of the user's email before the `@` sign.  The
+   * field value is the same for different requests from the same user, but
+   * different users can have similar names.  This information is also
+   * available to the application via the App Engine Users API.
+   * This field will be populated starting with App Engine 1.9.21.
+   * 
+ * + * string nickname = 40; + */ + public com.google.protobuf.ByteString + getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int URL_MAP_ENTRY_FIELD_NUMBER = 17; + private volatile java.lang.Object urlMapEntry_; + /** + *
+   * File or class that handled the request.
+   * 
+ * + * string url_map_entry = 17; + */ + public java.lang.String getUrlMapEntry() { + java.lang.Object ref = urlMapEntry_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + urlMapEntry_ = s; + return s; + } + } + /** + *
+   * File or class that handled the request.
+   * 
+ * + * string url_map_entry = 17; + */ + public com.google.protobuf.ByteString + getUrlMapEntryBytes() { + java.lang.Object ref = urlMapEntry_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + urlMapEntry_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HOST_FIELD_NUMBER = 20; + private volatile java.lang.Object host_; + /** + *
+   * Internet host and port number of the resource being requested.
+   * 
+ * + * string host = 20; + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } + } + /** + *
+   * Internet host and port number of the resource being requested.
+   * 
+ * + * string host = 20; + */ + public com.google.protobuf.ByteString + getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int COST_FIELD_NUMBER = 21; + private double cost_; + /** + *
+   * An indication of the relative cost of serving this request.
+   * 
+ * + * double cost = 21; + */ + public double getCost() { + return cost_; + } + + public static final int TASK_QUEUE_NAME_FIELD_NUMBER = 22; + private volatile java.lang.Object taskQueueName_; + /** + *
+   * Queue name of the request, in the case of an offline request.
+   * 
+ * + * string task_queue_name = 22; + */ + public java.lang.String getTaskQueueName() { + java.lang.Object ref = taskQueueName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + taskQueueName_ = s; + return s; + } + } + /** + *
+   * Queue name of the request, in the case of an offline request.
+   * 
+ * + * string task_queue_name = 22; + */ + public com.google.protobuf.ByteString + getTaskQueueNameBytes() { + java.lang.Object ref = taskQueueName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + taskQueueName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TASK_NAME_FIELD_NUMBER = 23; + private volatile java.lang.Object taskName_; + /** + *
+   * Task name of the request, in the case of an offline request.
+   * 
+ * + * string task_name = 23; + */ + public java.lang.String getTaskName() { + java.lang.Object ref = taskName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + taskName_ = s; + return s; + } + } + /** + *
+   * Task name of the request, in the case of an offline request.
+   * 
+ * + * string task_name = 23; + */ + public com.google.protobuf.ByteString + getTaskNameBytes() { + java.lang.Object ref = taskName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + taskName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int WAS_LOADING_REQUEST_FIELD_NUMBER = 24; + private boolean wasLoadingRequest_; + /** + *
+   * Whether this was a loading request for the instance.
+   * 
+ * + * bool was_loading_request = 24; + */ + public boolean getWasLoadingRequest() { + return wasLoadingRequest_; + } + + public static final int PENDING_TIME_FIELD_NUMBER = 25; + private com.google.protobuf.Duration pendingTime_; + /** + *
+   * Time this request spent in the pending request queue.
+   * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public boolean hasPendingTime() { + return pendingTime_ != null; + } + /** + *
+   * Time this request spent in the pending request queue.
+   * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public com.google.protobuf.Duration getPendingTime() { + return pendingTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : pendingTime_; + } + /** + *
+   * Time this request spent in the pending request queue.
+   * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public com.google.protobuf.DurationOrBuilder getPendingTimeOrBuilder() { + return getPendingTime(); + } + + public static final int INSTANCE_INDEX_FIELD_NUMBER = 26; + private int instanceIndex_; + /** + *
+   * If the instance processing this request belongs to a manually scaled
+   * module, then this is the 0-based index of the instance. Otherwise, this
+   * value is -1.
+   * 
+ * + * int32 instance_index = 26; + */ + public int getInstanceIndex() { + return instanceIndex_; + } + + public static final int FINISHED_FIELD_NUMBER = 27; + private boolean finished_; + /** + *
+   * Whether this request is finished or active.
+   * 
+ * + * bool finished = 27; + */ + public boolean getFinished() { + return finished_; + } + + public static final int FIRST_FIELD_NUMBER = 42; + private boolean first_; + /** + *
+   * Whether this is the first `RequestLog` entry for this request.  If an
+   * active request has several `RequestLog` entries written to Stackdriver
+   * Logging, then this field will be set for one of them.
+   * 
+ * + * bool first = 42; + */ + public boolean getFirst() { + return first_; + } + + public static final int INSTANCE_ID_FIELD_NUMBER = 28; + private volatile java.lang.Object instanceId_; + /** + *
+   * An identifier for the instance that handled the request.
+   * 
+ * + * string instance_id = 28; + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } + } + /** + *
+   * An identifier for the instance that handled the request.
+   * 
+ * + * string instance_id = 28; + */ + public com.google.protobuf.ByteString + getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINE_FIELD_NUMBER = 29; + private java.util.List line_; + /** + *
+   * A list of log lines emitted by the application while serving this request.
+   * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public java.util.List getLineList() { + return line_; + } + /** + *
+   * A list of log lines emitted by the application while serving this request.
+   * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public java.util.List + getLineOrBuilderList() { + return line_; + } + /** + *
+   * A list of log lines emitted by the application while serving this request.
+   * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public int getLineCount() { + return line_.size(); + } + /** + *
+   * A list of log lines emitted by the application while serving this request.
+   * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public com.google.appengine.logging.v1.LogLine getLine(int index) { + return line_.get(index); + } + /** + *
+   * A list of log lines emitted by the application while serving this request.
+   * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public com.google.appengine.logging.v1.LogLineOrBuilder getLineOrBuilder( + int index) { + return line_.get(index); + } + + public static final int APP_ENGINE_RELEASE_FIELD_NUMBER = 38; + private volatile java.lang.Object appEngineRelease_; + /** + *
+   * App Engine release version.
+   * 
+ * + * string app_engine_release = 38; + */ + public java.lang.String getAppEngineRelease() { + java.lang.Object ref = appEngineRelease_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appEngineRelease_ = s; + return s; + } + } + /** + *
+   * App Engine release version.
+   * 
+ * + * string app_engine_release = 38; + */ + public com.google.protobuf.ByteString + getAppEngineReleaseBytes() { + java.lang.Object ref = appEngineRelease_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appEngineRelease_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRACE_ID_FIELD_NUMBER = 39; + private volatile java.lang.Object traceId_; + /** + *
+   * Stackdriver Trace identifier for this request.
+   * 
+ * + * string trace_id = 39; + */ + public java.lang.String getTraceId() { + java.lang.Object ref = traceId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + traceId_ = s; + return s; + } + } + /** + *
+   * Stackdriver Trace identifier for this request.
+   * 
+ * + * string trace_id = 39; + */ + public com.google.protobuf.ByteString + getTraceIdBytes() { + java.lang.Object ref = traceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + traceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TRACE_SAMPLED_FIELD_NUMBER = 43; + private boolean traceSampled_; + /** + *
+   * If true, the value in the 'trace_id' field was sampled for storage in a
+   * trace backend.
+   * 
+ * + * bool trace_sampled = 43; + */ + public boolean getTraceSampled() { + return traceSampled_; + } + + public static final int SOURCE_REFERENCE_FIELD_NUMBER = 41; + private java.util.List sourceReference_; + /** + *
+   * Source code for the application that handled this request. There can be
+   * more than one source reference per deployed application if source code is
+   * distributed among multiple repositories.
+   * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public java.util.List getSourceReferenceList() { + return sourceReference_; + } + /** + *
+   * Source code for the application that handled this request. There can be
+   * more than one source reference per deployed application if source code is
+   * distributed among multiple repositories.
+   * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public java.util.List + getSourceReferenceOrBuilderList() { + return sourceReference_; + } + /** + *
+   * Source code for the application that handled this request. There can be
+   * more than one source reference per deployed application if source code is
+   * distributed among multiple repositories.
+   * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public int getSourceReferenceCount() { + return sourceReference_.size(); + } + /** + *
+   * Source code for the application that handled this request. There can be
+   * more than one source reference per deployed application if source code is
+   * distributed among multiple repositories.
+   * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public com.google.appengine.logging.v1.SourceReference getSourceReference(int index) { + return sourceReference_.get(index); + } + /** + *
+   * Source code for the application that handled this request. There can be
+   * more than one source reference per deployed application if source code is
+   * distributed among multiple repositories.
+   * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public com.google.appengine.logging.v1.SourceReferenceOrBuilder getSourceReferenceOrBuilder( + int index) { + return sourceReference_.get(index); + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getAppIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, appId_); + } + if (!getVersionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, versionId_); + } + if (!getRequestIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, requestId_); + } + if (!getIpBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, ip_); + } + if (startTime_ != null) { + output.writeMessage(6, getStartTime()); + } + if (endTime_ != null) { + output.writeMessage(7, getEndTime()); + } + if (latency_ != null) { + output.writeMessage(8, getLatency()); + } + if (megaCycles_ != 0L) { + output.writeInt64(9, megaCycles_); + } + if (!getMethodBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 10, method_); + } + if (!getResourceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 11, resource_); + } + if (!getHttpVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 12, httpVersion_); + } + if (status_ != 0) { + output.writeInt32(13, status_); + } + if (responseSize_ != 0L) { + output.writeInt64(14, responseSize_); + } + if (!getReferrerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 15, referrer_); + } + if (!getUserAgentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 16, userAgent_); + } + if (!getUrlMapEntryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 17, urlMapEntry_); + } + if (!getHostBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 20, host_); + } + if (cost_ != 0D) { + output.writeDouble(21, cost_); + } + if (!getTaskQueueNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 22, taskQueueName_); + } + if (!getTaskNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 23, taskName_); + } + if (wasLoadingRequest_ != false) { + output.writeBool(24, wasLoadingRequest_); + } + if (pendingTime_ != null) { + output.writeMessage(25, getPendingTime()); + } + if (instanceIndex_ != 0) { + output.writeInt32(26, instanceIndex_); + } + if (finished_ != false) { + output.writeBool(27, finished_); + } + if (!getInstanceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 28, instanceId_); + } + for (int i = 0; i < line_.size(); i++) { + output.writeMessage(29, line_.get(i)); + } + if (!getModuleIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 37, moduleId_); + } + if (!getAppEngineReleaseBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 38, appEngineRelease_); + } + if (!getTraceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 39, traceId_); + } + if (!getNicknameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 40, nickname_); + } + for (int i = 0; i < sourceReference_.size(); i++) { + output.writeMessage(41, sourceReference_.get(i)); + } + if (first_ != false) { + output.writeBool(42, first_); + } + if (traceSampled_ != false) { + output.writeBool(43, traceSampled_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getAppIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, appId_); + } + if (!getVersionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, versionId_); + } + if (!getRequestIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, requestId_); + } + if (!getIpBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, ip_); + } + if (startTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, getStartTime()); + } + if (endTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(7, getEndTime()); + } + if (latency_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(8, getLatency()); + } + if (megaCycles_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, megaCycles_); + } + if (!getMethodBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(10, method_); + } + if (!getResourceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(11, resource_); + } + if (!getHttpVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(12, httpVersion_); + } + if (status_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(13, status_); + } + if (responseSize_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(14, responseSize_); + } + if (!getReferrerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(15, referrer_); + } + if (!getUserAgentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(16, userAgent_); + } + if (!getUrlMapEntryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(17, urlMapEntry_); + } + if (!getHostBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(20, host_); + } + if (cost_ != 0D) { + size += com.google.protobuf.CodedOutputStream + .computeDoubleSize(21, cost_); + } + if (!getTaskQueueNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(22, taskQueueName_); + } + if (!getTaskNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(23, taskName_); + } + if (wasLoadingRequest_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(24, wasLoadingRequest_); + } + if (pendingTime_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(25, getPendingTime()); + } + if (instanceIndex_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(26, instanceIndex_); + } + if (finished_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(27, finished_); + } + if (!getInstanceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(28, instanceId_); + } + for (int i = 0; i < line_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(29, line_.get(i)); + } + if (!getModuleIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(37, moduleId_); + } + if (!getAppEngineReleaseBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(38, appEngineRelease_); + } + if (!getTraceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(39, traceId_); + } + if (!getNicknameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(40, nickname_); + } + for (int i = 0; i < sourceReference_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(41, sourceReference_.get(i)); + } + if (first_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(42, first_); + } + if (traceSampled_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(43, traceSampled_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.appengine.logging.v1.RequestLog)) { + return super.equals(obj); + } + com.google.appengine.logging.v1.RequestLog other = (com.google.appengine.logging.v1.RequestLog) obj; + + boolean result = true; + result = result && getAppId() + .equals(other.getAppId()); + result = result && getModuleId() + .equals(other.getModuleId()); + result = result && getVersionId() + .equals(other.getVersionId()); + result = result && getRequestId() + .equals(other.getRequestId()); + result = result && getIp() + .equals(other.getIp()); + result = result && (hasStartTime() == other.hasStartTime()); + if (hasStartTime()) { + result = result && getStartTime() + .equals(other.getStartTime()); + } + result = result && (hasEndTime() == other.hasEndTime()); + if (hasEndTime()) { + result = result && getEndTime() + .equals(other.getEndTime()); + } + result = result && (hasLatency() == other.hasLatency()); + if (hasLatency()) { + result = result && getLatency() + .equals(other.getLatency()); + } + result = result && (getMegaCycles() + == other.getMegaCycles()); + result = result && getMethod() + .equals(other.getMethod()); + result = result && getResource() + .equals(other.getResource()); + result = result && getHttpVersion() + .equals(other.getHttpVersion()); + result = result && (getStatus() + == other.getStatus()); + result = result && (getResponseSize() + == other.getResponseSize()); + result = result && getReferrer() + .equals(other.getReferrer()); + result = result && getUserAgent() + .equals(other.getUserAgent()); + result = result && getNickname() + .equals(other.getNickname()); + result = result && getUrlMapEntry() + .equals(other.getUrlMapEntry()); + result = result && getHost() + .equals(other.getHost()); + result = result && ( + java.lang.Double.doubleToLongBits(getCost()) + == java.lang.Double.doubleToLongBits( + other.getCost())); + result = result && getTaskQueueName() + .equals(other.getTaskQueueName()); + result = result && getTaskName() + .equals(other.getTaskName()); + result = result && (getWasLoadingRequest() + == other.getWasLoadingRequest()); + result = result && (hasPendingTime() == other.hasPendingTime()); + if (hasPendingTime()) { + result = result && getPendingTime() + .equals(other.getPendingTime()); + } + result = result && (getInstanceIndex() + == other.getInstanceIndex()); + result = result && (getFinished() + == other.getFinished()); + result = result && (getFirst() + == other.getFirst()); + result = result && getInstanceId() + .equals(other.getInstanceId()); + result = result && getLineList() + .equals(other.getLineList()); + result = result && getAppEngineRelease() + .equals(other.getAppEngineRelease()); + result = result && getTraceId() + .equals(other.getTraceId()); + result = result && (getTraceSampled() + == other.getTraceSampled()); + result = result && getSourceReferenceList() + .equals(other.getSourceReferenceList()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + APP_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppId().hashCode(); + hash = (37 * hash) + MODULE_ID_FIELD_NUMBER; + hash = (53 * hash) + getModuleId().hashCode(); + hash = (37 * hash) + VERSION_ID_FIELD_NUMBER; + hash = (53 * hash) + getVersionId().hashCode(); + hash = (37 * hash) + REQUEST_ID_FIELD_NUMBER; + hash = (53 * hash) + getRequestId().hashCode(); + hash = (37 * hash) + IP_FIELD_NUMBER; + hash = (53 * hash) + getIp().hashCode(); + if (hasStartTime()) { + hash = (37 * hash) + START_TIME_FIELD_NUMBER; + hash = (53 * hash) + getStartTime().hashCode(); + } + if (hasEndTime()) { + hash = (37 * hash) + END_TIME_FIELD_NUMBER; + hash = (53 * hash) + getEndTime().hashCode(); + } + if (hasLatency()) { + hash = (37 * hash) + LATENCY_FIELD_NUMBER; + hash = (53 * hash) + getLatency().hashCode(); + } + hash = (37 * hash) + MEGA_CYCLES_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getMegaCycles()); + hash = (37 * hash) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + getMethod().hashCode(); + hash = (37 * hash) + RESOURCE_FIELD_NUMBER; + hash = (53 * hash) + getResource().hashCode(); + hash = (37 * hash) + HTTP_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getHttpVersion().hashCode(); + hash = (37 * hash) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + getStatus(); + hash = (37 * hash) + RESPONSE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getResponseSize()); + hash = (37 * hash) + REFERRER_FIELD_NUMBER; + hash = (53 * hash) + getReferrer().hashCode(); + hash = (37 * hash) + USER_AGENT_FIELD_NUMBER; + hash = (53 * hash) + getUserAgent().hashCode(); + hash = (37 * hash) + NICKNAME_FIELD_NUMBER; + hash = (53 * hash) + getNickname().hashCode(); + hash = (37 * hash) + URL_MAP_ENTRY_FIELD_NUMBER; + hash = (53 * hash) + getUrlMapEntry().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + COST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + java.lang.Double.doubleToLongBits(getCost())); + hash = (37 * hash) + TASK_QUEUE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTaskQueueName().hashCode(); + hash = (37 * hash) + TASK_NAME_FIELD_NUMBER; + hash = (53 * hash) + getTaskName().hashCode(); + hash = (37 * hash) + WAS_LOADING_REQUEST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getWasLoadingRequest()); + if (hasPendingTime()) { + hash = (37 * hash) + PENDING_TIME_FIELD_NUMBER; + hash = (53 * hash) + getPendingTime().hashCode(); + } + hash = (37 * hash) + INSTANCE_INDEX_FIELD_NUMBER; + hash = (53 * hash) + getInstanceIndex(); + hash = (37 * hash) + FINISHED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFinished()); + hash = (37 * hash) + FIRST_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getFirst()); + hash = (37 * hash) + INSTANCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getInstanceId().hashCode(); + if (getLineCount() > 0) { + hash = (37 * hash) + LINE_FIELD_NUMBER; + hash = (53 * hash) + getLineList().hashCode(); + } + hash = (37 * hash) + APP_ENGINE_RELEASE_FIELD_NUMBER; + hash = (53 * hash) + getAppEngineRelease().hashCode(); + hash = (37 * hash) + TRACE_ID_FIELD_NUMBER; + hash = (53 * hash) + getTraceId().hashCode(); + hash = (37 * hash) + TRACE_SAMPLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getTraceSampled()); + if (getSourceReferenceCount() > 0) { + hash = (37 * hash) + SOURCE_REFERENCE_FIELD_NUMBER; + hash = (53 * hash) + getSourceReferenceList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.appengine.logging.v1.RequestLog parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.RequestLog parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.RequestLog parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.RequestLog parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.RequestLog parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.RequestLog parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.RequestLog parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.RequestLog parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.appengine.logging.v1.RequestLog parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.RequestLog parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.appengine.logging.v1.RequestLog parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.RequestLog parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.appengine.logging.v1.RequestLog prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Complete log information about a single HTTP request to an App Engine
+   * application.
+   * 
+ * + * Protobuf type {@code google.appengine.logging.v1.RequestLog} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.appengine.logging.v1.RequestLog) + com.google.appengine.logging.v1.RequestLogOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_RequestLog_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_RequestLog_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.appengine.logging.v1.RequestLog.class, com.google.appengine.logging.v1.RequestLog.Builder.class); + } + + // Construct using com.google.appengine.logging.v1.RequestLog.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getLineFieldBuilder(); + getSourceReferenceFieldBuilder(); + } + } + public Builder clear() { + super.clear(); + appId_ = ""; + + moduleId_ = ""; + + versionId_ = ""; + + requestId_ = ""; + + ip_ = ""; + + if (startTimeBuilder_ == null) { + startTime_ = null; + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + if (endTimeBuilder_ == null) { + endTime_ = null; + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + if (latencyBuilder_ == null) { + latency_ = null; + } else { + latency_ = null; + latencyBuilder_ = null; + } + megaCycles_ = 0L; + + method_ = ""; + + resource_ = ""; + + httpVersion_ = ""; + + status_ = 0; + + responseSize_ = 0L; + + referrer_ = ""; + + userAgent_ = ""; + + nickname_ = ""; + + urlMapEntry_ = ""; + + host_ = ""; + + cost_ = 0D; + + taskQueueName_ = ""; + + taskName_ = ""; + + wasLoadingRequest_ = false; + + if (pendingTimeBuilder_ == null) { + pendingTime_ = null; + } else { + pendingTime_ = null; + pendingTimeBuilder_ = null; + } + instanceIndex_ = 0; + + finished_ = false; + + first_ = false; + + instanceId_ = ""; + + if (lineBuilder_ == null) { + line_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x10000000); + } else { + lineBuilder_.clear(); + } + appEngineRelease_ = ""; + + traceId_ = ""; + + traceSampled_ = false; + + if (sourceReferenceBuilder_ == null) { + sourceReference_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00000001); + } else { + sourceReferenceBuilder_.clear(); + } + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_RequestLog_descriptor; + } + + public com.google.appengine.logging.v1.RequestLog getDefaultInstanceForType() { + return com.google.appengine.logging.v1.RequestLog.getDefaultInstance(); + } + + public com.google.appengine.logging.v1.RequestLog build() { + com.google.appengine.logging.v1.RequestLog result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.appengine.logging.v1.RequestLog buildPartial() { + com.google.appengine.logging.v1.RequestLog result = new com.google.appengine.logging.v1.RequestLog(this); + int from_bitField0_ = bitField0_; + int from_bitField1_ = bitField1_; + int to_bitField0_ = 0; + result.appId_ = appId_; + result.moduleId_ = moduleId_; + result.versionId_ = versionId_; + result.requestId_ = requestId_; + result.ip_ = ip_; + if (startTimeBuilder_ == null) { + result.startTime_ = startTime_; + } else { + result.startTime_ = startTimeBuilder_.build(); + } + if (endTimeBuilder_ == null) { + result.endTime_ = endTime_; + } else { + result.endTime_ = endTimeBuilder_.build(); + } + if (latencyBuilder_ == null) { + result.latency_ = latency_; + } else { + result.latency_ = latencyBuilder_.build(); + } + result.megaCycles_ = megaCycles_; + result.method_ = method_; + result.resource_ = resource_; + result.httpVersion_ = httpVersion_; + result.status_ = status_; + result.responseSize_ = responseSize_; + result.referrer_ = referrer_; + result.userAgent_ = userAgent_; + result.nickname_ = nickname_; + result.urlMapEntry_ = urlMapEntry_; + result.host_ = host_; + result.cost_ = cost_; + result.taskQueueName_ = taskQueueName_; + result.taskName_ = taskName_; + result.wasLoadingRequest_ = wasLoadingRequest_; + if (pendingTimeBuilder_ == null) { + result.pendingTime_ = pendingTime_; + } else { + result.pendingTime_ = pendingTimeBuilder_.build(); + } + result.instanceIndex_ = instanceIndex_; + result.finished_ = finished_; + result.first_ = first_; + result.instanceId_ = instanceId_; + if (lineBuilder_ == null) { + if (((bitField0_ & 0x10000000) == 0x10000000)) { + line_ = java.util.Collections.unmodifiableList(line_); + bitField0_ = (bitField0_ & ~0x10000000); + } + result.line_ = line_; + } else { + result.line_ = lineBuilder_.build(); + } + result.appEngineRelease_ = appEngineRelease_; + result.traceId_ = traceId_; + result.traceSampled_ = traceSampled_; + if (sourceReferenceBuilder_ == null) { + if (((bitField1_ & 0x00000001) == 0x00000001)) { + sourceReference_ = java.util.Collections.unmodifiableList(sourceReference_); + bitField1_ = (bitField1_ & ~0x00000001); + } + result.sourceReference_ = sourceReference_; + } else { + result.sourceReference_ = sourceReferenceBuilder_.build(); + } + result.bitField0_ = to_bitField0_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.appengine.logging.v1.RequestLog) { + return mergeFrom((com.google.appengine.logging.v1.RequestLog)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.appengine.logging.v1.RequestLog other) { + if (other == com.google.appengine.logging.v1.RequestLog.getDefaultInstance()) return this; + if (!other.getAppId().isEmpty()) { + appId_ = other.appId_; + onChanged(); + } + if (!other.getModuleId().isEmpty()) { + moduleId_ = other.moduleId_; + onChanged(); + } + if (!other.getVersionId().isEmpty()) { + versionId_ = other.versionId_; + onChanged(); + } + if (!other.getRequestId().isEmpty()) { + requestId_ = other.requestId_; + onChanged(); + } + if (!other.getIp().isEmpty()) { + ip_ = other.ip_; + onChanged(); + } + if (other.hasStartTime()) { + mergeStartTime(other.getStartTime()); + } + if (other.hasEndTime()) { + mergeEndTime(other.getEndTime()); + } + if (other.hasLatency()) { + mergeLatency(other.getLatency()); + } + if (other.getMegaCycles() != 0L) { + setMegaCycles(other.getMegaCycles()); + } + if (!other.getMethod().isEmpty()) { + method_ = other.method_; + onChanged(); + } + if (!other.getResource().isEmpty()) { + resource_ = other.resource_; + onChanged(); + } + if (!other.getHttpVersion().isEmpty()) { + httpVersion_ = other.httpVersion_; + onChanged(); + } + if (other.getStatus() != 0) { + setStatus(other.getStatus()); + } + if (other.getResponseSize() != 0L) { + setResponseSize(other.getResponseSize()); + } + if (!other.getReferrer().isEmpty()) { + referrer_ = other.referrer_; + onChanged(); + } + if (!other.getUserAgent().isEmpty()) { + userAgent_ = other.userAgent_; + onChanged(); + } + if (!other.getNickname().isEmpty()) { + nickname_ = other.nickname_; + onChanged(); + } + if (!other.getUrlMapEntry().isEmpty()) { + urlMapEntry_ = other.urlMapEntry_; + onChanged(); + } + if (!other.getHost().isEmpty()) { + host_ = other.host_; + onChanged(); + } + if (other.getCost() != 0D) { + setCost(other.getCost()); + } + if (!other.getTaskQueueName().isEmpty()) { + taskQueueName_ = other.taskQueueName_; + onChanged(); + } + if (!other.getTaskName().isEmpty()) { + taskName_ = other.taskName_; + onChanged(); + } + if (other.getWasLoadingRequest() != false) { + setWasLoadingRequest(other.getWasLoadingRequest()); + } + if (other.hasPendingTime()) { + mergePendingTime(other.getPendingTime()); + } + if (other.getInstanceIndex() != 0) { + setInstanceIndex(other.getInstanceIndex()); + } + if (other.getFinished() != false) { + setFinished(other.getFinished()); + } + if (other.getFirst() != false) { + setFirst(other.getFirst()); + } + if (!other.getInstanceId().isEmpty()) { + instanceId_ = other.instanceId_; + onChanged(); + } + if (lineBuilder_ == null) { + if (!other.line_.isEmpty()) { + if (line_.isEmpty()) { + line_ = other.line_; + bitField0_ = (bitField0_ & ~0x10000000); + } else { + ensureLineIsMutable(); + line_.addAll(other.line_); + } + onChanged(); + } + } else { + if (!other.line_.isEmpty()) { + if (lineBuilder_.isEmpty()) { + lineBuilder_.dispose(); + lineBuilder_ = null; + line_ = other.line_; + bitField0_ = (bitField0_ & ~0x10000000); + lineBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getLineFieldBuilder() : null; + } else { + lineBuilder_.addAllMessages(other.line_); + } + } + } + if (!other.getAppEngineRelease().isEmpty()) { + appEngineRelease_ = other.appEngineRelease_; + onChanged(); + } + if (!other.getTraceId().isEmpty()) { + traceId_ = other.traceId_; + onChanged(); + } + if (other.getTraceSampled() != false) { + setTraceSampled(other.getTraceSampled()); + } + if (sourceReferenceBuilder_ == null) { + if (!other.sourceReference_.isEmpty()) { + if (sourceReference_.isEmpty()) { + sourceReference_ = other.sourceReference_; + bitField1_ = (bitField1_ & ~0x00000001); + } else { + ensureSourceReferenceIsMutable(); + sourceReference_.addAll(other.sourceReference_); + } + onChanged(); + } + } else { + if (!other.sourceReference_.isEmpty()) { + if (sourceReferenceBuilder_.isEmpty()) { + sourceReferenceBuilder_.dispose(); + sourceReferenceBuilder_ = null; + sourceReference_ = other.sourceReference_; + bitField1_ = (bitField1_ & ~0x00000001); + sourceReferenceBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSourceReferenceFieldBuilder() : null; + } else { + sourceReferenceBuilder_.addAllMessages(other.sourceReference_); + } + } + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.appengine.logging.v1.RequestLog parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.appengine.logging.v1.RequestLog) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + private int bitField1_; + + private java.lang.Object appId_ = ""; + /** + *
+     * Application that handled this request.
+     * 
+ * + * string app_id = 1; + */ + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Application that handled this request.
+     * 
+ * + * string app_id = 1; + */ + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Application that handled this request.
+     * 
+ * + * string app_id = 1; + */ + public Builder setAppId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appId_ = value; + onChanged(); + return this; + } + /** + *
+     * Application that handled this request.
+     * 
+ * + * string app_id = 1; + */ + public Builder clearAppId() { + + appId_ = getDefaultInstance().getAppId(); + onChanged(); + return this; + } + /** + *
+     * Application that handled this request.
+     * 
+ * + * string app_id = 1; + */ + public Builder setAppIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appId_ = value; + onChanged(); + return this; + } + + private java.lang.Object moduleId_ = ""; + /** + *
+     * Module of the application that handled this request.
+     * 
+ * + * string module_id = 37; + */ + public java.lang.String getModuleId() { + java.lang.Object ref = moduleId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + moduleId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Module of the application that handled this request.
+     * 
+ * + * string module_id = 37; + */ + public com.google.protobuf.ByteString + getModuleIdBytes() { + java.lang.Object ref = moduleId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + moduleId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Module of the application that handled this request.
+     * 
+ * + * string module_id = 37; + */ + public Builder setModuleId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + moduleId_ = value; + onChanged(); + return this; + } + /** + *
+     * Module of the application that handled this request.
+     * 
+ * + * string module_id = 37; + */ + public Builder clearModuleId() { + + moduleId_ = getDefaultInstance().getModuleId(); + onChanged(); + return this; + } + /** + *
+     * Module of the application that handled this request.
+     * 
+ * + * string module_id = 37; + */ + public Builder setModuleIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + moduleId_ = value; + onChanged(); + return this; + } + + private java.lang.Object versionId_ = ""; + /** + *
+     * Version of the application that handled this request.
+     * 
+ * + * string version_id = 2; + */ + public java.lang.String getVersionId() { + java.lang.Object ref = versionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + versionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Version of the application that handled this request.
+     * 
+ * + * string version_id = 2; + */ + public com.google.protobuf.ByteString + getVersionIdBytes() { + java.lang.Object ref = versionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + versionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Version of the application that handled this request.
+     * 
+ * + * string version_id = 2; + */ + public Builder setVersionId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + versionId_ = value; + onChanged(); + return this; + } + /** + *
+     * Version of the application that handled this request.
+     * 
+ * + * string version_id = 2; + */ + public Builder clearVersionId() { + + versionId_ = getDefaultInstance().getVersionId(); + onChanged(); + return this; + } + /** + *
+     * Version of the application that handled this request.
+     * 
+ * + * string version_id = 2; + */ + public Builder setVersionIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + versionId_ = value; + onChanged(); + return this; + } + + private java.lang.Object requestId_ = ""; + /** + *
+     * Globally unique identifier for a request, which is based on the request
+     * start time.  Request IDs for requests which started later will compare
+     * greater as strings than those for requests which started earlier.
+     * 
+ * + * string request_id = 3; + */ + public java.lang.String getRequestId() { + java.lang.Object ref = requestId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + requestId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Globally unique identifier for a request, which is based on the request
+     * start time.  Request IDs for requests which started later will compare
+     * greater as strings than those for requests which started earlier.
+     * 
+ * + * string request_id = 3; + */ + public com.google.protobuf.ByteString + getRequestIdBytes() { + java.lang.Object ref = requestId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + requestId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Globally unique identifier for a request, which is based on the request
+     * start time.  Request IDs for requests which started later will compare
+     * greater as strings than those for requests which started earlier.
+     * 
+ * + * string request_id = 3; + */ + public Builder setRequestId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + requestId_ = value; + onChanged(); + return this; + } + /** + *
+     * Globally unique identifier for a request, which is based on the request
+     * start time.  Request IDs for requests which started later will compare
+     * greater as strings than those for requests which started earlier.
+     * 
+ * + * string request_id = 3; + */ + public Builder clearRequestId() { + + requestId_ = getDefaultInstance().getRequestId(); + onChanged(); + return this; + } + /** + *
+     * Globally unique identifier for a request, which is based on the request
+     * start time.  Request IDs for requests which started later will compare
+     * greater as strings than those for requests which started earlier.
+     * 
+ * + * string request_id = 3; + */ + public Builder setRequestIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + requestId_ = value; + onChanged(); + return this; + } + + private java.lang.Object ip_ = ""; + /** + *
+     * Origin IP address.
+     * 
+ * + * string ip = 4; + */ + public java.lang.String getIp() { + java.lang.Object ref = ip_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + ip_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Origin IP address.
+     * 
+ * + * string ip = 4; + */ + public com.google.protobuf.ByteString + getIpBytes() { + java.lang.Object ref = ip_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + ip_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Origin IP address.
+     * 
+ * + * string ip = 4; + */ + public Builder setIp( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + ip_ = value; + onChanged(); + return this; + } + /** + *
+     * Origin IP address.
+     * 
+ * + * string ip = 4; + */ + public Builder clearIp() { + + ip_ = getDefaultInstance().getIp(); + onChanged(); + return this; + } + /** + *
+     * Origin IP address.
+     * 
+ * + * string ip = 4; + */ + public Builder setIpBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + ip_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Timestamp startTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> startTimeBuilder_; + /** + *
+     * Time when the request started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public boolean hasStartTime() { + return startTimeBuilder_ != null || startTime_ != null; + } + /** + *
+     * Time when the request started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.Timestamp getStartTime() { + if (startTimeBuilder_ == null) { + return startTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } else { + return startTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time when the request started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder setStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + startTime_ = value; + onChanged(); + } else { + startTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time when the request started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder setStartTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (startTimeBuilder_ == null) { + startTime_ = builderForValue.build(); + onChanged(); + } else { + startTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time when the request started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder mergeStartTime(com.google.protobuf.Timestamp value) { + if (startTimeBuilder_ == null) { + if (startTime_ != null) { + startTime_ = + com.google.protobuf.Timestamp.newBuilder(startTime_).mergeFrom(value).buildPartial(); + } else { + startTime_ = value; + } + onChanged(); + } else { + startTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time when the request started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public Builder clearStartTime() { + if (startTimeBuilder_ == null) { + startTime_ = null; + onChanged(); + } else { + startTime_ = null; + startTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time when the request started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.Timestamp.Builder getStartTimeBuilder() { + + onChanged(); + return getStartTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time when the request started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + public com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder() { + if (startTimeBuilder_ != null) { + return startTimeBuilder_.getMessageOrBuilder(); + } else { + return startTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : startTime_; + } + } + /** + *
+     * Time when the request started.
+     * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getStartTimeFieldBuilder() { + if (startTimeBuilder_ == null) { + startTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getStartTime(), + getParentForChildren(), + isClean()); + startTime_ = null; + } + return startTimeBuilder_; + } + + private com.google.protobuf.Timestamp endTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> endTimeBuilder_; + /** + *
+     * Time when the request finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public boolean hasEndTime() { + return endTimeBuilder_ != null || endTime_ != null; + } + /** + *
+     * Time when the request finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.Timestamp getEndTime() { + if (endTimeBuilder_ == null) { + return endTime_ == null ? com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } else { + return endTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time when the request finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder setEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + endTime_ = value; + onChanged(); + } else { + endTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time when the request finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder setEndTime( + com.google.protobuf.Timestamp.Builder builderForValue) { + if (endTimeBuilder_ == null) { + endTime_ = builderForValue.build(); + onChanged(); + } else { + endTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time when the request finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder mergeEndTime(com.google.protobuf.Timestamp value) { + if (endTimeBuilder_ == null) { + if (endTime_ != null) { + endTime_ = + com.google.protobuf.Timestamp.newBuilder(endTime_).mergeFrom(value).buildPartial(); + } else { + endTime_ = value; + } + onChanged(); + } else { + endTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time when the request finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public Builder clearEndTime() { + if (endTimeBuilder_ == null) { + endTime_ = null; + onChanged(); + } else { + endTime_ = null; + endTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time when the request finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.Timestamp.Builder getEndTimeBuilder() { + + onChanged(); + return getEndTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time when the request finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + public com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder() { + if (endTimeBuilder_ != null) { + return endTimeBuilder_.getMessageOrBuilder(); + } else { + return endTime_ == null ? + com.google.protobuf.Timestamp.getDefaultInstance() : endTime_; + } + } + /** + *
+     * Time when the request finished.
+     * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder> + getEndTimeFieldBuilder() { + if (endTimeBuilder_ == null) { + endTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Timestamp, com.google.protobuf.Timestamp.Builder, com.google.protobuf.TimestampOrBuilder>( + getEndTime(), + getParentForChildren(), + isClean()); + endTime_ = null; + } + return endTimeBuilder_; + } + + private com.google.protobuf.Duration latency_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> latencyBuilder_; + /** + *
+     * Latency of the request.
+     * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public boolean hasLatency() { + return latencyBuilder_ != null || latency_ != null; + } + /** + *
+     * Latency of the request.
+     * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public com.google.protobuf.Duration getLatency() { + if (latencyBuilder_ == null) { + return latency_ == null ? com.google.protobuf.Duration.getDefaultInstance() : latency_; + } else { + return latencyBuilder_.getMessage(); + } + } + /** + *
+     * Latency of the request.
+     * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public Builder setLatency(com.google.protobuf.Duration value) { + if (latencyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + latency_ = value; + onChanged(); + } else { + latencyBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Latency of the request.
+     * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public Builder setLatency( + com.google.protobuf.Duration.Builder builderForValue) { + if (latencyBuilder_ == null) { + latency_ = builderForValue.build(); + onChanged(); + } else { + latencyBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Latency of the request.
+     * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public Builder mergeLatency(com.google.protobuf.Duration value) { + if (latencyBuilder_ == null) { + if (latency_ != null) { + latency_ = + com.google.protobuf.Duration.newBuilder(latency_).mergeFrom(value).buildPartial(); + } else { + latency_ = value; + } + onChanged(); + } else { + latencyBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Latency of the request.
+     * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public Builder clearLatency() { + if (latencyBuilder_ == null) { + latency_ = null; + onChanged(); + } else { + latency_ = null; + latencyBuilder_ = null; + } + + return this; + } + /** + *
+     * Latency of the request.
+     * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public com.google.protobuf.Duration.Builder getLatencyBuilder() { + + onChanged(); + return getLatencyFieldBuilder().getBuilder(); + } + /** + *
+     * Latency of the request.
+     * 
+ * + * .google.protobuf.Duration latency = 8; + */ + public com.google.protobuf.DurationOrBuilder getLatencyOrBuilder() { + if (latencyBuilder_ != null) { + return latencyBuilder_.getMessageOrBuilder(); + } else { + return latency_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : latency_; + } + } + /** + *
+     * Latency of the request.
+     * 
+ * + * .google.protobuf.Duration latency = 8; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getLatencyFieldBuilder() { + if (latencyBuilder_ == null) { + latencyBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getLatency(), + getParentForChildren(), + isClean()); + latency_ = null; + } + return latencyBuilder_; + } + + private long megaCycles_ ; + /** + *
+     * Number of CPU megacycles used to process request.
+     * 
+ * + * int64 mega_cycles = 9; + */ + public long getMegaCycles() { + return megaCycles_; + } + /** + *
+     * Number of CPU megacycles used to process request.
+     * 
+ * + * int64 mega_cycles = 9; + */ + public Builder setMegaCycles(long value) { + + megaCycles_ = value; + onChanged(); + return this; + } + /** + *
+     * Number of CPU megacycles used to process request.
+     * 
+ * + * int64 mega_cycles = 9; + */ + public Builder clearMegaCycles() { + + megaCycles_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object method_ = ""; + /** + *
+     * Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
+     * 
+ * + * string method = 10; + */ + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
+     * 
+ * + * string method = 10; + */ + public com.google.protobuf.ByteString + getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
+     * 
+ * + * string method = 10; + */ + public Builder setMethod( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + method_ = value; + onChanged(); + return this; + } + /** + *
+     * Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
+     * 
+ * + * string method = 10; + */ + public Builder clearMethod() { + + method_ = getDefaultInstance().getMethod(); + onChanged(); + return this; + } + /** + *
+     * Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
+     * 
+ * + * string method = 10; + */ + public Builder setMethodBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + method_ = value; + onChanged(); + return this; + } + + private java.lang.Object resource_ = ""; + /** + *
+     * Contains the path and query portion of the URL that was requested. For
+     * example, if the URL was "http://example.com/app?name=val", the resource
+     * would be "/app?name=val".  The fragment identifier, which is identified by
+     * the `#` character, is not included.
+     * 
+ * + * string resource = 11; + */ + public java.lang.String getResource() { + java.lang.Object ref = resource_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resource_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Contains the path and query portion of the URL that was requested. For
+     * example, if the URL was "http://example.com/app?name=val", the resource
+     * would be "/app?name=val".  The fragment identifier, which is identified by
+     * the `#` character, is not included.
+     * 
+ * + * string resource = 11; + */ + public com.google.protobuf.ByteString + getResourceBytes() { + java.lang.Object ref = resource_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resource_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Contains the path and query portion of the URL that was requested. For
+     * example, if the URL was "http://example.com/app?name=val", the resource
+     * would be "/app?name=val".  The fragment identifier, which is identified by
+     * the `#` character, is not included.
+     * 
+ * + * string resource = 11; + */ + public Builder setResource( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resource_ = value; + onChanged(); + return this; + } + /** + *
+     * Contains the path and query portion of the URL that was requested. For
+     * example, if the URL was "http://example.com/app?name=val", the resource
+     * would be "/app?name=val".  The fragment identifier, which is identified by
+     * the `#` character, is not included.
+     * 
+ * + * string resource = 11; + */ + public Builder clearResource() { + + resource_ = getDefaultInstance().getResource(); + onChanged(); + return this; + } + /** + *
+     * Contains the path and query portion of the URL that was requested. For
+     * example, if the URL was "http://example.com/app?name=val", the resource
+     * would be "/app?name=val".  The fragment identifier, which is identified by
+     * the `#` character, is not included.
+     * 
+ * + * string resource = 11; + */ + public Builder setResourceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resource_ = value; + onChanged(); + return this; + } + + private java.lang.Object httpVersion_ = ""; + /** + *
+     * HTTP version of request. Example: `"HTTP/1.1"`.
+     * 
+ * + * string http_version = 12; + */ + public java.lang.String getHttpVersion() { + java.lang.Object ref = httpVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + httpVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * HTTP version of request. Example: `"HTTP/1.1"`.
+     * 
+ * + * string http_version = 12; + */ + public com.google.protobuf.ByteString + getHttpVersionBytes() { + java.lang.Object ref = httpVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + httpVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * HTTP version of request. Example: `"HTTP/1.1"`.
+     * 
+ * + * string http_version = 12; + */ + public Builder setHttpVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + httpVersion_ = value; + onChanged(); + return this; + } + /** + *
+     * HTTP version of request. Example: `"HTTP/1.1"`.
+     * 
+ * + * string http_version = 12; + */ + public Builder clearHttpVersion() { + + httpVersion_ = getDefaultInstance().getHttpVersion(); + onChanged(); + return this; + } + /** + *
+     * HTTP version of request. Example: `"HTTP/1.1"`.
+     * 
+ * + * string http_version = 12; + */ + public Builder setHttpVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + httpVersion_ = value; + onChanged(); + return this; + } + + private int status_ ; + /** + *
+     * HTTP response status code. Example: 200, 404.
+     * 
+ * + * int32 status = 13; + */ + public int getStatus() { + return status_; + } + /** + *
+     * HTTP response status code. Example: 200, 404.
+     * 
+ * + * int32 status = 13; + */ + public Builder setStatus(int value) { + + status_ = value; + onChanged(); + return this; + } + /** + *
+     * HTTP response status code. Example: 200, 404.
+     * 
+ * + * int32 status = 13; + */ + public Builder clearStatus() { + + status_ = 0; + onChanged(); + return this; + } + + private long responseSize_ ; + /** + *
+     * Size in bytes sent back to client by request.
+     * 
+ * + * int64 response_size = 14; + */ + public long getResponseSize() { + return responseSize_; + } + /** + *
+     * Size in bytes sent back to client by request.
+     * 
+ * + * int64 response_size = 14; + */ + public Builder setResponseSize(long value) { + + responseSize_ = value; + onChanged(); + return this; + } + /** + *
+     * Size in bytes sent back to client by request.
+     * 
+ * + * int64 response_size = 14; + */ + public Builder clearResponseSize() { + + responseSize_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object referrer_ = ""; + /** + *
+     * Referrer URL of request.
+     * 
+ * + * string referrer = 15; + */ + public java.lang.String getReferrer() { + java.lang.Object ref = referrer_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + referrer_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Referrer URL of request.
+     * 
+ * + * string referrer = 15; + */ + public com.google.protobuf.ByteString + getReferrerBytes() { + java.lang.Object ref = referrer_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + referrer_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Referrer URL of request.
+     * 
+ * + * string referrer = 15; + */ + public Builder setReferrer( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + referrer_ = value; + onChanged(); + return this; + } + /** + *
+     * Referrer URL of request.
+     * 
+ * + * string referrer = 15; + */ + public Builder clearReferrer() { + + referrer_ = getDefaultInstance().getReferrer(); + onChanged(); + return this; + } + /** + *
+     * Referrer URL of request.
+     * 
+ * + * string referrer = 15; + */ + public Builder setReferrerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + referrer_ = value; + onChanged(); + return this; + } + + private java.lang.Object userAgent_ = ""; + /** + *
+     * User agent that made the request.
+     * 
+ * + * string user_agent = 16; + */ + public java.lang.String getUserAgent() { + java.lang.Object ref = userAgent_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + userAgent_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * User agent that made the request.
+     * 
+ * + * string user_agent = 16; + */ + public com.google.protobuf.ByteString + getUserAgentBytes() { + java.lang.Object ref = userAgent_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + userAgent_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * User agent that made the request.
+     * 
+ * + * string user_agent = 16; + */ + public Builder setUserAgent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + userAgent_ = value; + onChanged(); + return this; + } + /** + *
+     * User agent that made the request.
+     * 
+ * + * string user_agent = 16; + */ + public Builder clearUserAgent() { + + userAgent_ = getDefaultInstance().getUserAgent(); + onChanged(); + return this; + } + /** + *
+     * User agent that made the request.
+     * 
+ * + * string user_agent = 16; + */ + public Builder setUserAgentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + userAgent_ = value; + onChanged(); + return this; + } + + private java.lang.Object nickname_ = ""; + /** + *
+     * The logged-in user who made the request.
+     * Most likely, this is the part of the user's email before the `@` sign.  The
+     * field value is the same for different requests from the same user, but
+     * different users can have similar names.  This information is also
+     * available to the application via the App Engine Users API.
+     * This field will be populated starting with App Engine 1.9.21.
+     * 
+ * + * string nickname = 40; + */ + public java.lang.String getNickname() { + java.lang.Object ref = nickname_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + nickname_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The logged-in user who made the request.
+     * Most likely, this is the part of the user's email before the `@` sign.  The
+     * field value is the same for different requests from the same user, but
+     * different users can have similar names.  This information is also
+     * available to the application via the App Engine Users API.
+     * This field will be populated starting with App Engine 1.9.21.
+     * 
+ * + * string nickname = 40; + */ + public com.google.protobuf.ByteString + getNicknameBytes() { + java.lang.Object ref = nickname_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + nickname_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The logged-in user who made the request.
+     * Most likely, this is the part of the user's email before the `@` sign.  The
+     * field value is the same for different requests from the same user, but
+     * different users can have similar names.  This information is also
+     * available to the application via the App Engine Users API.
+     * This field will be populated starting with App Engine 1.9.21.
+     * 
+ * + * string nickname = 40; + */ + public Builder setNickname( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + nickname_ = value; + onChanged(); + return this; + } + /** + *
+     * The logged-in user who made the request.
+     * Most likely, this is the part of the user's email before the `@` sign.  The
+     * field value is the same for different requests from the same user, but
+     * different users can have similar names.  This information is also
+     * available to the application via the App Engine Users API.
+     * This field will be populated starting with App Engine 1.9.21.
+     * 
+ * + * string nickname = 40; + */ + public Builder clearNickname() { + + nickname_ = getDefaultInstance().getNickname(); + onChanged(); + return this; + } + /** + *
+     * The logged-in user who made the request.
+     * Most likely, this is the part of the user's email before the `@` sign.  The
+     * field value is the same for different requests from the same user, but
+     * different users can have similar names.  This information is also
+     * available to the application via the App Engine Users API.
+     * This field will be populated starting with App Engine 1.9.21.
+     * 
+ * + * string nickname = 40; + */ + public Builder setNicknameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + nickname_ = value; + onChanged(); + return this; + } + + private java.lang.Object urlMapEntry_ = ""; + /** + *
+     * File or class that handled the request.
+     * 
+ * + * string url_map_entry = 17; + */ + public java.lang.String getUrlMapEntry() { + java.lang.Object ref = urlMapEntry_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + urlMapEntry_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * File or class that handled the request.
+     * 
+ * + * string url_map_entry = 17; + */ + public com.google.protobuf.ByteString + getUrlMapEntryBytes() { + java.lang.Object ref = urlMapEntry_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + urlMapEntry_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * File or class that handled the request.
+     * 
+ * + * string url_map_entry = 17; + */ + public Builder setUrlMapEntry( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + urlMapEntry_ = value; + onChanged(); + return this; + } + /** + *
+     * File or class that handled the request.
+     * 
+ * + * string url_map_entry = 17; + */ + public Builder clearUrlMapEntry() { + + urlMapEntry_ = getDefaultInstance().getUrlMapEntry(); + onChanged(); + return this; + } + /** + *
+     * File or class that handled the request.
+     * 
+ * + * string url_map_entry = 17; + */ + public Builder setUrlMapEntryBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + urlMapEntry_ = value; + onChanged(); + return this; + } + + private java.lang.Object host_ = ""; + /** + *
+     * Internet host and port number of the resource being requested.
+     * 
+ * + * string host = 20; + */ + public java.lang.String getHost() { + java.lang.Object ref = host_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + host_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Internet host and port number of the resource being requested.
+     * 
+ * + * string host = 20; + */ + public com.google.protobuf.ByteString + getHostBytes() { + java.lang.Object ref = host_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + host_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Internet host and port number of the resource being requested.
+     * 
+ * + * string host = 20; + */ + public Builder setHost( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + host_ = value; + onChanged(); + return this; + } + /** + *
+     * Internet host and port number of the resource being requested.
+     * 
+ * + * string host = 20; + */ + public Builder clearHost() { + + host_ = getDefaultInstance().getHost(); + onChanged(); + return this; + } + /** + *
+     * Internet host and port number of the resource being requested.
+     * 
+ * + * string host = 20; + */ + public Builder setHostBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + host_ = value; + onChanged(); + return this; + } + + private double cost_ ; + /** + *
+     * An indication of the relative cost of serving this request.
+     * 
+ * + * double cost = 21; + */ + public double getCost() { + return cost_; + } + /** + *
+     * An indication of the relative cost of serving this request.
+     * 
+ * + * double cost = 21; + */ + public Builder setCost(double value) { + + cost_ = value; + onChanged(); + return this; + } + /** + *
+     * An indication of the relative cost of serving this request.
+     * 
+ * + * double cost = 21; + */ + public Builder clearCost() { + + cost_ = 0D; + onChanged(); + return this; + } + + private java.lang.Object taskQueueName_ = ""; + /** + *
+     * Queue name of the request, in the case of an offline request.
+     * 
+ * + * string task_queue_name = 22; + */ + public java.lang.String getTaskQueueName() { + java.lang.Object ref = taskQueueName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + taskQueueName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Queue name of the request, in the case of an offline request.
+     * 
+ * + * string task_queue_name = 22; + */ + public com.google.protobuf.ByteString + getTaskQueueNameBytes() { + java.lang.Object ref = taskQueueName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + taskQueueName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Queue name of the request, in the case of an offline request.
+     * 
+ * + * string task_queue_name = 22; + */ + public Builder setTaskQueueName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + taskQueueName_ = value; + onChanged(); + return this; + } + /** + *
+     * Queue name of the request, in the case of an offline request.
+     * 
+ * + * string task_queue_name = 22; + */ + public Builder clearTaskQueueName() { + + taskQueueName_ = getDefaultInstance().getTaskQueueName(); + onChanged(); + return this; + } + /** + *
+     * Queue name of the request, in the case of an offline request.
+     * 
+ * + * string task_queue_name = 22; + */ + public Builder setTaskQueueNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + taskQueueName_ = value; + onChanged(); + return this; + } + + private java.lang.Object taskName_ = ""; + /** + *
+     * Task name of the request, in the case of an offline request.
+     * 
+ * + * string task_name = 23; + */ + public java.lang.String getTaskName() { + java.lang.Object ref = taskName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + taskName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Task name of the request, in the case of an offline request.
+     * 
+ * + * string task_name = 23; + */ + public com.google.protobuf.ByteString + getTaskNameBytes() { + java.lang.Object ref = taskName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + taskName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Task name of the request, in the case of an offline request.
+     * 
+ * + * string task_name = 23; + */ + public Builder setTaskName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + taskName_ = value; + onChanged(); + return this; + } + /** + *
+     * Task name of the request, in the case of an offline request.
+     * 
+ * + * string task_name = 23; + */ + public Builder clearTaskName() { + + taskName_ = getDefaultInstance().getTaskName(); + onChanged(); + return this; + } + /** + *
+     * Task name of the request, in the case of an offline request.
+     * 
+ * + * string task_name = 23; + */ + public Builder setTaskNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + taskName_ = value; + onChanged(); + return this; + } + + private boolean wasLoadingRequest_ ; + /** + *
+     * Whether this was a loading request for the instance.
+     * 
+ * + * bool was_loading_request = 24; + */ + public boolean getWasLoadingRequest() { + return wasLoadingRequest_; + } + /** + *
+     * Whether this was a loading request for the instance.
+     * 
+ * + * bool was_loading_request = 24; + */ + public Builder setWasLoadingRequest(boolean value) { + + wasLoadingRequest_ = value; + onChanged(); + return this; + } + /** + *
+     * Whether this was a loading request for the instance.
+     * 
+ * + * bool was_loading_request = 24; + */ + public Builder clearWasLoadingRequest() { + + wasLoadingRequest_ = false; + onChanged(); + return this; + } + + private com.google.protobuf.Duration pendingTime_ = null; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> pendingTimeBuilder_; + /** + *
+     * Time this request spent in the pending request queue.
+     * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public boolean hasPendingTime() { + return pendingTimeBuilder_ != null || pendingTime_ != null; + } + /** + *
+     * Time this request spent in the pending request queue.
+     * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public com.google.protobuf.Duration getPendingTime() { + if (pendingTimeBuilder_ == null) { + return pendingTime_ == null ? com.google.protobuf.Duration.getDefaultInstance() : pendingTime_; + } else { + return pendingTimeBuilder_.getMessage(); + } + } + /** + *
+     * Time this request spent in the pending request queue.
+     * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public Builder setPendingTime(com.google.protobuf.Duration value) { + if (pendingTimeBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + pendingTime_ = value; + onChanged(); + } else { + pendingTimeBuilder_.setMessage(value); + } + + return this; + } + /** + *
+     * Time this request spent in the pending request queue.
+     * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public Builder setPendingTime( + com.google.protobuf.Duration.Builder builderForValue) { + if (pendingTimeBuilder_ == null) { + pendingTime_ = builderForValue.build(); + onChanged(); + } else { + pendingTimeBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+     * Time this request spent in the pending request queue.
+     * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public Builder mergePendingTime(com.google.protobuf.Duration value) { + if (pendingTimeBuilder_ == null) { + if (pendingTime_ != null) { + pendingTime_ = + com.google.protobuf.Duration.newBuilder(pendingTime_).mergeFrom(value).buildPartial(); + } else { + pendingTime_ = value; + } + onChanged(); + } else { + pendingTimeBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+     * Time this request spent in the pending request queue.
+     * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public Builder clearPendingTime() { + if (pendingTimeBuilder_ == null) { + pendingTime_ = null; + onChanged(); + } else { + pendingTime_ = null; + pendingTimeBuilder_ = null; + } + + return this; + } + /** + *
+     * Time this request spent in the pending request queue.
+     * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public com.google.protobuf.Duration.Builder getPendingTimeBuilder() { + + onChanged(); + return getPendingTimeFieldBuilder().getBuilder(); + } + /** + *
+     * Time this request spent in the pending request queue.
+     * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + public com.google.protobuf.DurationOrBuilder getPendingTimeOrBuilder() { + if (pendingTimeBuilder_ != null) { + return pendingTimeBuilder_.getMessageOrBuilder(); + } else { + return pendingTime_ == null ? + com.google.protobuf.Duration.getDefaultInstance() : pendingTime_; + } + } + /** + *
+     * Time this request spent in the pending request queue.
+     * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder> + getPendingTimeFieldBuilder() { + if (pendingTimeBuilder_ == null) { + pendingTimeBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Duration, com.google.protobuf.Duration.Builder, com.google.protobuf.DurationOrBuilder>( + getPendingTime(), + getParentForChildren(), + isClean()); + pendingTime_ = null; + } + return pendingTimeBuilder_; + } + + private int instanceIndex_ ; + /** + *
+     * If the instance processing this request belongs to a manually scaled
+     * module, then this is the 0-based index of the instance. Otherwise, this
+     * value is -1.
+     * 
+ * + * int32 instance_index = 26; + */ + public int getInstanceIndex() { + return instanceIndex_; + } + /** + *
+     * If the instance processing this request belongs to a manually scaled
+     * module, then this is the 0-based index of the instance. Otherwise, this
+     * value is -1.
+     * 
+ * + * int32 instance_index = 26; + */ + public Builder setInstanceIndex(int value) { + + instanceIndex_ = value; + onChanged(); + return this; + } + /** + *
+     * If the instance processing this request belongs to a manually scaled
+     * module, then this is the 0-based index of the instance. Otherwise, this
+     * value is -1.
+     * 
+ * + * int32 instance_index = 26; + */ + public Builder clearInstanceIndex() { + + instanceIndex_ = 0; + onChanged(); + return this; + } + + private boolean finished_ ; + /** + *
+     * Whether this request is finished or active.
+     * 
+ * + * bool finished = 27; + */ + public boolean getFinished() { + return finished_; + } + /** + *
+     * Whether this request is finished or active.
+     * 
+ * + * bool finished = 27; + */ + public Builder setFinished(boolean value) { + + finished_ = value; + onChanged(); + return this; + } + /** + *
+     * Whether this request is finished or active.
+     * 
+ * + * bool finished = 27; + */ + public Builder clearFinished() { + + finished_ = false; + onChanged(); + return this; + } + + private boolean first_ ; + /** + *
+     * Whether this is the first `RequestLog` entry for this request.  If an
+     * active request has several `RequestLog` entries written to Stackdriver
+     * Logging, then this field will be set for one of them.
+     * 
+ * + * bool first = 42; + */ + public boolean getFirst() { + return first_; + } + /** + *
+     * Whether this is the first `RequestLog` entry for this request.  If an
+     * active request has several `RequestLog` entries written to Stackdriver
+     * Logging, then this field will be set for one of them.
+     * 
+ * + * bool first = 42; + */ + public Builder setFirst(boolean value) { + + first_ = value; + onChanged(); + return this; + } + /** + *
+     * Whether this is the first `RequestLog` entry for this request.  If an
+     * active request has several `RequestLog` entries written to Stackdriver
+     * Logging, then this field will be set for one of them.
+     * 
+ * + * bool first = 42; + */ + public Builder clearFirst() { + + first_ = false; + onChanged(); + return this; + } + + private java.lang.Object instanceId_ = ""; + /** + *
+     * An identifier for the instance that handled the request.
+     * 
+ * + * string instance_id = 28; + */ + public java.lang.String getInstanceId() { + java.lang.Object ref = instanceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + instanceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * An identifier for the instance that handled the request.
+     * 
+ * + * string instance_id = 28; + */ + public com.google.protobuf.ByteString + getInstanceIdBytes() { + java.lang.Object ref = instanceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + instanceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * An identifier for the instance that handled the request.
+     * 
+ * + * string instance_id = 28; + */ + public Builder setInstanceId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + instanceId_ = value; + onChanged(); + return this; + } + /** + *
+     * An identifier for the instance that handled the request.
+     * 
+ * + * string instance_id = 28; + */ + public Builder clearInstanceId() { + + instanceId_ = getDefaultInstance().getInstanceId(); + onChanged(); + return this; + } + /** + *
+     * An identifier for the instance that handled the request.
+     * 
+ * + * string instance_id = 28; + */ + public Builder setInstanceIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + instanceId_ = value; + onChanged(); + return this; + } + + private java.util.List line_ = + java.util.Collections.emptyList(); + private void ensureLineIsMutable() { + if (!((bitField0_ & 0x10000000) == 0x10000000)) { + line_ = new java.util.ArrayList(line_); + bitField0_ |= 0x10000000; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.appengine.logging.v1.LogLine, com.google.appengine.logging.v1.LogLine.Builder, com.google.appengine.logging.v1.LogLineOrBuilder> lineBuilder_; + + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public java.util.List getLineList() { + if (lineBuilder_ == null) { + return java.util.Collections.unmodifiableList(line_); + } else { + return lineBuilder_.getMessageList(); + } + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public int getLineCount() { + if (lineBuilder_ == null) { + return line_.size(); + } else { + return lineBuilder_.getCount(); + } + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public com.google.appengine.logging.v1.LogLine getLine(int index) { + if (lineBuilder_ == null) { + return line_.get(index); + } else { + return lineBuilder_.getMessage(index); + } + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public Builder setLine( + int index, com.google.appengine.logging.v1.LogLine value) { + if (lineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLineIsMutable(); + line_.set(index, value); + onChanged(); + } else { + lineBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public Builder setLine( + int index, com.google.appengine.logging.v1.LogLine.Builder builderForValue) { + if (lineBuilder_ == null) { + ensureLineIsMutable(); + line_.set(index, builderForValue.build()); + onChanged(); + } else { + lineBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public Builder addLine(com.google.appengine.logging.v1.LogLine value) { + if (lineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLineIsMutable(); + line_.add(value); + onChanged(); + } else { + lineBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public Builder addLine( + int index, com.google.appengine.logging.v1.LogLine value) { + if (lineBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureLineIsMutable(); + line_.add(index, value); + onChanged(); + } else { + lineBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public Builder addLine( + com.google.appengine.logging.v1.LogLine.Builder builderForValue) { + if (lineBuilder_ == null) { + ensureLineIsMutable(); + line_.add(builderForValue.build()); + onChanged(); + } else { + lineBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public Builder addLine( + int index, com.google.appengine.logging.v1.LogLine.Builder builderForValue) { + if (lineBuilder_ == null) { + ensureLineIsMutable(); + line_.add(index, builderForValue.build()); + onChanged(); + } else { + lineBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public Builder addAllLine( + java.lang.Iterable values) { + if (lineBuilder_ == null) { + ensureLineIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, line_); + onChanged(); + } else { + lineBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public Builder clearLine() { + if (lineBuilder_ == null) { + line_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x10000000); + onChanged(); + } else { + lineBuilder_.clear(); + } + return this; + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public Builder removeLine(int index) { + if (lineBuilder_ == null) { + ensureLineIsMutable(); + line_.remove(index); + onChanged(); + } else { + lineBuilder_.remove(index); + } + return this; + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public com.google.appengine.logging.v1.LogLine.Builder getLineBuilder( + int index) { + return getLineFieldBuilder().getBuilder(index); + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public com.google.appengine.logging.v1.LogLineOrBuilder getLineOrBuilder( + int index) { + if (lineBuilder_ == null) { + return line_.get(index); } else { + return lineBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public java.util.List + getLineOrBuilderList() { + if (lineBuilder_ != null) { + return lineBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(line_); + } + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public com.google.appengine.logging.v1.LogLine.Builder addLineBuilder() { + return getLineFieldBuilder().addBuilder( + com.google.appengine.logging.v1.LogLine.getDefaultInstance()); + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public com.google.appengine.logging.v1.LogLine.Builder addLineBuilder( + int index) { + return getLineFieldBuilder().addBuilder( + index, com.google.appengine.logging.v1.LogLine.getDefaultInstance()); + } + /** + *
+     * A list of log lines emitted by the application while serving this request.
+     * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + public java.util.List + getLineBuilderList() { + return getLineFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.appengine.logging.v1.LogLine, com.google.appengine.logging.v1.LogLine.Builder, com.google.appengine.logging.v1.LogLineOrBuilder> + getLineFieldBuilder() { + if (lineBuilder_ == null) { + lineBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.appengine.logging.v1.LogLine, com.google.appengine.logging.v1.LogLine.Builder, com.google.appengine.logging.v1.LogLineOrBuilder>( + line_, + ((bitField0_ & 0x10000000) == 0x10000000), + getParentForChildren(), + isClean()); + line_ = null; + } + return lineBuilder_; + } + + private java.lang.Object appEngineRelease_ = ""; + /** + *
+     * App Engine release version.
+     * 
+ * + * string app_engine_release = 38; + */ + public java.lang.String getAppEngineRelease() { + java.lang.Object ref = appEngineRelease_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appEngineRelease_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * App Engine release version.
+     * 
+ * + * string app_engine_release = 38; + */ + public com.google.protobuf.ByteString + getAppEngineReleaseBytes() { + java.lang.Object ref = appEngineRelease_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appEngineRelease_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * App Engine release version.
+     * 
+ * + * string app_engine_release = 38; + */ + public Builder setAppEngineRelease( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appEngineRelease_ = value; + onChanged(); + return this; + } + /** + *
+     * App Engine release version.
+     * 
+ * + * string app_engine_release = 38; + */ + public Builder clearAppEngineRelease() { + + appEngineRelease_ = getDefaultInstance().getAppEngineRelease(); + onChanged(); + return this; + } + /** + *
+     * App Engine release version.
+     * 
+ * + * string app_engine_release = 38; + */ + public Builder setAppEngineReleaseBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appEngineRelease_ = value; + onChanged(); + return this; + } + + private java.lang.Object traceId_ = ""; + /** + *
+     * Stackdriver Trace identifier for this request.
+     * 
+ * + * string trace_id = 39; + */ + public java.lang.String getTraceId() { + java.lang.Object ref = traceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + traceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Stackdriver Trace identifier for this request.
+     * 
+ * + * string trace_id = 39; + */ + public com.google.protobuf.ByteString + getTraceIdBytes() { + java.lang.Object ref = traceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + traceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Stackdriver Trace identifier for this request.
+     * 
+ * + * string trace_id = 39; + */ + public Builder setTraceId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + traceId_ = value; + onChanged(); + return this; + } + /** + *
+     * Stackdriver Trace identifier for this request.
+     * 
+ * + * string trace_id = 39; + */ + public Builder clearTraceId() { + + traceId_ = getDefaultInstance().getTraceId(); + onChanged(); + return this; + } + /** + *
+     * Stackdriver Trace identifier for this request.
+     * 
+ * + * string trace_id = 39; + */ + public Builder setTraceIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + traceId_ = value; + onChanged(); + return this; + } + + private boolean traceSampled_ ; + /** + *
+     * If true, the value in the 'trace_id' field was sampled for storage in a
+     * trace backend.
+     * 
+ * + * bool trace_sampled = 43; + */ + public boolean getTraceSampled() { + return traceSampled_; + } + /** + *
+     * If true, the value in the 'trace_id' field was sampled for storage in a
+     * trace backend.
+     * 
+ * + * bool trace_sampled = 43; + */ + public Builder setTraceSampled(boolean value) { + + traceSampled_ = value; + onChanged(); + return this; + } + /** + *
+     * If true, the value in the 'trace_id' field was sampled for storage in a
+     * trace backend.
+     * 
+ * + * bool trace_sampled = 43; + */ + public Builder clearTraceSampled() { + + traceSampled_ = false; + onChanged(); + return this; + } + + private java.util.List sourceReference_ = + java.util.Collections.emptyList(); + private void ensureSourceReferenceIsMutable() { + if (!((bitField1_ & 0x00000001) == 0x00000001)) { + sourceReference_ = new java.util.ArrayList(sourceReference_); + bitField1_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.appengine.logging.v1.SourceReference, com.google.appengine.logging.v1.SourceReference.Builder, com.google.appengine.logging.v1.SourceReferenceOrBuilder> sourceReferenceBuilder_; + + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public java.util.List getSourceReferenceList() { + if (sourceReferenceBuilder_ == null) { + return java.util.Collections.unmodifiableList(sourceReference_); + } else { + return sourceReferenceBuilder_.getMessageList(); + } + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public int getSourceReferenceCount() { + if (sourceReferenceBuilder_ == null) { + return sourceReference_.size(); + } else { + return sourceReferenceBuilder_.getCount(); + } + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public com.google.appengine.logging.v1.SourceReference getSourceReference(int index) { + if (sourceReferenceBuilder_ == null) { + return sourceReference_.get(index); + } else { + return sourceReferenceBuilder_.getMessage(index); + } + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public Builder setSourceReference( + int index, com.google.appengine.logging.v1.SourceReference value) { + if (sourceReferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourceReferenceIsMutable(); + sourceReference_.set(index, value); + onChanged(); + } else { + sourceReferenceBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public Builder setSourceReference( + int index, com.google.appengine.logging.v1.SourceReference.Builder builderForValue) { + if (sourceReferenceBuilder_ == null) { + ensureSourceReferenceIsMutable(); + sourceReference_.set(index, builderForValue.build()); + onChanged(); + } else { + sourceReferenceBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public Builder addSourceReference(com.google.appengine.logging.v1.SourceReference value) { + if (sourceReferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourceReferenceIsMutable(); + sourceReference_.add(value); + onChanged(); + } else { + sourceReferenceBuilder_.addMessage(value); + } + return this; + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public Builder addSourceReference( + int index, com.google.appengine.logging.v1.SourceReference value) { + if (sourceReferenceBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSourceReferenceIsMutable(); + sourceReference_.add(index, value); + onChanged(); + } else { + sourceReferenceBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public Builder addSourceReference( + com.google.appengine.logging.v1.SourceReference.Builder builderForValue) { + if (sourceReferenceBuilder_ == null) { + ensureSourceReferenceIsMutable(); + sourceReference_.add(builderForValue.build()); + onChanged(); + } else { + sourceReferenceBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public Builder addSourceReference( + int index, com.google.appengine.logging.v1.SourceReference.Builder builderForValue) { + if (sourceReferenceBuilder_ == null) { + ensureSourceReferenceIsMutable(); + sourceReference_.add(index, builderForValue.build()); + onChanged(); + } else { + sourceReferenceBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public Builder addAllSourceReference( + java.lang.Iterable values) { + if (sourceReferenceBuilder_ == null) { + ensureSourceReferenceIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, sourceReference_); + onChanged(); + } else { + sourceReferenceBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public Builder clearSourceReference() { + if (sourceReferenceBuilder_ == null) { + sourceReference_ = java.util.Collections.emptyList(); + bitField1_ = (bitField1_ & ~0x00000001); + onChanged(); + } else { + sourceReferenceBuilder_.clear(); + } + return this; + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public Builder removeSourceReference(int index) { + if (sourceReferenceBuilder_ == null) { + ensureSourceReferenceIsMutable(); + sourceReference_.remove(index); + onChanged(); + } else { + sourceReferenceBuilder_.remove(index); + } + return this; + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public com.google.appengine.logging.v1.SourceReference.Builder getSourceReferenceBuilder( + int index) { + return getSourceReferenceFieldBuilder().getBuilder(index); + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public com.google.appengine.logging.v1.SourceReferenceOrBuilder getSourceReferenceOrBuilder( + int index) { + if (sourceReferenceBuilder_ == null) { + return sourceReference_.get(index); } else { + return sourceReferenceBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public java.util.List + getSourceReferenceOrBuilderList() { + if (sourceReferenceBuilder_ != null) { + return sourceReferenceBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(sourceReference_); + } + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public com.google.appengine.logging.v1.SourceReference.Builder addSourceReferenceBuilder() { + return getSourceReferenceFieldBuilder().addBuilder( + com.google.appengine.logging.v1.SourceReference.getDefaultInstance()); + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public com.google.appengine.logging.v1.SourceReference.Builder addSourceReferenceBuilder( + int index) { + return getSourceReferenceFieldBuilder().addBuilder( + index, com.google.appengine.logging.v1.SourceReference.getDefaultInstance()); + } + /** + *
+     * Source code for the application that handled this request. There can be
+     * more than one source reference per deployed application if source code is
+     * distributed among multiple repositories.
+     * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + public java.util.List + getSourceReferenceBuilderList() { + return getSourceReferenceFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + com.google.appengine.logging.v1.SourceReference, com.google.appengine.logging.v1.SourceReference.Builder, com.google.appengine.logging.v1.SourceReferenceOrBuilder> + getSourceReferenceFieldBuilder() { + if (sourceReferenceBuilder_ == null) { + sourceReferenceBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + com.google.appengine.logging.v1.SourceReference, com.google.appengine.logging.v1.SourceReference.Builder, com.google.appengine.logging.v1.SourceReferenceOrBuilder>( + sourceReference_, + ((bitField1_ & 0x00000001) == 0x00000001), + getParentForChildren(), + isClean()); + sourceReference_ = null; + } + return sourceReferenceBuilder_; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.appengine.logging.v1.RequestLog) + } + + // @@protoc_insertion_point(class_scope:google.appengine.logging.v1.RequestLog) + private static final com.google.appengine.logging.v1.RequestLog DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.appengine.logging.v1.RequestLog(); + } + + public static com.google.appengine.logging.v1.RequestLog getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public RequestLog parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new RequestLog(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.appengine.logging.v1.RequestLog getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/appengine/logging/v1/RequestLogOrBuilder.java b/src/main/java/com/google/appengine/logging/v1/RequestLogOrBuilder.java new file mode 100644 index 00000000000..42455ee9907 --- /dev/null +++ b/src/main/java/com/google/appengine/logging/v1/RequestLogOrBuilder.java @@ -0,0 +1,637 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/appengine/logging/v1/request_log.proto + +package com.google.appengine.logging.v1; + +public interface RequestLogOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.appengine.logging.v1.RequestLog) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Application that handled this request.
+   * 
+ * + * string app_id = 1; + */ + java.lang.String getAppId(); + /** + *
+   * Application that handled this request.
+   * 
+ * + * string app_id = 1; + */ + com.google.protobuf.ByteString + getAppIdBytes(); + + /** + *
+   * Module of the application that handled this request.
+   * 
+ * + * string module_id = 37; + */ + java.lang.String getModuleId(); + /** + *
+   * Module of the application that handled this request.
+   * 
+ * + * string module_id = 37; + */ + com.google.protobuf.ByteString + getModuleIdBytes(); + + /** + *
+   * Version of the application that handled this request.
+   * 
+ * + * string version_id = 2; + */ + java.lang.String getVersionId(); + /** + *
+   * Version of the application that handled this request.
+   * 
+ * + * string version_id = 2; + */ + com.google.protobuf.ByteString + getVersionIdBytes(); + + /** + *
+   * Globally unique identifier for a request, which is based on the request
+   * start time.  Request IDs for requests which started later will compare
+   * greater as strings than those for requests which started earlier.
+   * 
+ * + * string request_id = 3; + */ + java.lang.String getRequestId(); + /** + *
+   * Globally unique identifier for a request, which is based on the request
+   * start time.  Request IDs for requests which started later will compare
+   * greater as strings than those for requests which started earlier.
+   * 
+ * + * string request_id = 3; + */ + com.google.protobuf.ByteString + getRequestIdBytes(); + + /** + *
+   * Origin IP address.
+   * 
+ * + * string ip = 4; + */ + java.lang.String getIp(); + /** + *
+   * Origin IP address.
+   * 
+ * + * string ip = 4; + */ + com.google.protobuf.ByteString + getIpBytes(); + + /** + *
+   * Time when the request started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + boolean hasStartTime(); + /** + *
+   * Time when the request started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + com.google.protobuf.Timestamp getStartTime(); + /** + *
+   * Time when the request started.
+   * 
+ * + * .google.protobuf.Timestamp start_time = 6; + */ + com.google.protobuf.TimestampOrBuilder getStartTimeOrBuilder(); + + /** + *
+   * Time when the request finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + boolean hasEndTime(); + /** + *
+   * Time when the request finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + com.google.protobuf.Timestamp getEndTime(); + /** + *
+   * Time when the request finished.
+   * 
+ * + * .google.protobuf.Timestamp end_time = 7; + */ + com.google.protobuf.TimestampOrBuilder getEndTimeOrBuilder(); + + /** + *
+   * Latency of the request.
+   * 
+ * + * .google.protobuf.Duration latency = 8; + */ + boolean hasLatency(); + /** + *
+   * Latency of the request.
+   * 
+ * + * .google.protobuf.Duration latency = 8; + */ + com.google.protobuf.Duration getLatency(); + /** + *
+   * Latency of the request.
+   * 
+ * + * .google.protobuf.Duration latency = 8; + */ + com.google.protobuf.DurationOrBuilder getLatencyOrBuilder(); + + /** + *
+   * Number of CPU megacycles used to process request.
+   * 
+ * + * int64 mega_cycles = 9; + */ + long getMegaCycles(); + + /** + *
+   * Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
+   * 
+ * + * string method = 10; + */ + java.lang.String getMethod(); + /** + *
+   * Request method. Example: `"GET"`, `"HEAD"`, `"PUT"`, `"POST"`, `"DELETE"`.
+   * 
+ * + * string method = 10; + */ + com.google.protobuf.ByteString + getMethodBytes(); + + /** + *
+   * Contains the path and query portion of the URL that was requested. For
+   * example, if the URL was "http://example.com/app?name=val", the resource
+   * would be "/app?name=val".  The fragment identifier, which is identified by
+   * the `#` character, is not included.
+   * 
+ * + * string resource = 11; + */ + java.lang.String getResource(); + /** + *
+   * Contains the path and query portion of the URL that was requested. For
+   * example, if the URL was "http://example.com/app?name=val", the resource
+   * would be "/app?name=val".  The fragment identifier, which is identified by
+   * the `#` character, is not included.
+   * 
+ * + * string resource = 11; + */ + com.google.protobuf.ByteString + getResourceBytes(); + + /** + *
+   * HTTP version of request. Example: `"HTTP/1.1"`.
+   * 
+ * + * string http_version = 12; + */ + java.lang.String getHttpVersion(); + /** + *
+   * HTTP version of request. Example: `"HTTP/1.1"`.
+   * 
+ * + * string http_version = 12; + */ + com.google.protobuf.ByteString + getHttpVersionBytes(); + + /** + *
+   * HTTP response status code. Example: 200, 404.
+   * 
+ * + * int32 status = 13; + */ + int getStatus(); + + /** + *
+   * Size in bytes sent back to client by request.
+   * 
+ * + * int64 response_size = 14; + */ + long getResponseSize(); + + /** + *
+   * Referrer URL of request.
+   * 
+ * + * string referrer = 15; + */ + java.lang.String getReferrer(); + /** + *
+   * Referrer URL of request.
+   * 
+ * + * string referrer = 15; + */ + com.google.protobuf.ByteString + getReferrerBytes(); + + /** + *
+   * User agent that made the request.
+   * 
+ * + * string user_agent = 16; + */ + java.lang.String getUserAgent(); + /** + *
+   * User agent that made the request.
+   * 
+ * + * string user_agent = 16; + */ + com.google.protobuf.ByteString + getUserAgentBytes(); + + /** + *
+   * The logged-in user who made the request.
+   * Most likely, this is the part of the user's email before the `@` sign.  The
+   * field value is the same for different requests from the same user, but
+   * different users can have similar names.  This information is also
+   * available to the application via the App Engine Users API.
+   * This field will be populated starting with App Engine 1.9.21.
+   * 
+ * + * string nickname = 40; + */ + java.lang.String getNickname(); + /** + *
+   * The logged-in user who made the request.
+   * Most likely, this is the part of the user's email before the `@` sign.  The
+   * field value is the same for different requests from the same user, but
+   * different users can have similar names.  This information is also
+   * available to the application via the App Engine Users API.
+   * This field will be populated starting with App Engine 1.9.21.
+   * 
+ * + * string nickname = 40; + */ + com.google.protobuf.ByteString + getNicknameBytes(); + + /** + *
+   * File or class that handled the request.
+   * 
+ * + * string url_map_entry = 17; + */ + java.lang.String getUrlMapEntry(); + /** + *
+   * File or class that handled the request.
+   * 
+ * + * string url_map_entry = 17; + */ + com.google.protobuf.ByteString + getUrlMapEntryBytes(); + + /** + *
+   * Internet host and port number of the resource being requested.
+   * 
+ * + * string host = 20; + */ + java.lang.String getHost(); + /** + *
+   * Internet host and port number of the resource being requested.
+   * 
+ * + * string host = 20; + */ + com.google.protobuf.ByteString + getHostBytes(); + + /** + *
+   * An indication of the relative cost of serving this request.
+   * 
+ * + * double cost = 21; + */ + double getCost(); + + /** + *
+   * Queue name of the request, in the case of an offline request.
+   * 
+ * + * string task_queue_name = 22; + */ + java.lang.String getTaskQueueName(); + /** + *
+   * Queue name of the request, in the case of an offline request.
+   * 
+ * + * string task_queue_name = 22; + */ + com.google.protobuf.ByteString + getTaskQueueNameBytes(); + + /** + *
+   * Task name of the request, in the case of an offline request.
+   * 
+ * + * string task_name = 23; + */ + java.lang.String getTaskName(); + /** + *
+   * Task name of the request, in the case of an offline request.
+   * 
+ * + * string task_name = 23; + */ + com.google.protobuf.ByteString + getTaskNameBytes(); + + /** + *
+   * Whether this was a loading request for the instance.
+   * 
+ * + * bool was_loading_request = 24; + */ + boolean getWasLoadingRequest(); + + /** + *
+   * Time this request spent in the pending request queue.
+   * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + boolean hasPendingTime(); + /** + *
+   * Time this request spent in the pending request queue.
+   * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + com.google.protobuf.Duration getPendingTime(); + /** + *
+   * Time this request spent in the pending request queue.
+   * 
+ * + * .google.protobuf.Duration pending_time = 25; + */ + com.google.protobuf.DurationOrBuilder getPendingTimeOrBuilder(); + + /** + *
+   * If the instance processing this request belongs to a manually scaled
+   * module, then this is the 0-based index of the instance. Otherwise, this
+   * value is -1.
+   * 
+ * + * int32 instance_index = 26; + */ + int getInstanceIndex(); + + /** + *
+   * Whether this request is finished or active.
+   * 
+ * + * bool finished = 27; + */ + boolean getFinished(); + + /** + *
+   * Whether this is the first `RequestLog` entry for this request.  If an
+   * active request has several `RequestLog` entries written to Stackdriver
+   * Logging, then this field will be set for one of them.
+   * 
+ * + * bool first = 42; + */ + boolean getFirst(); + + /** + *
+   * An identifier for the instance that handled the request.
+   * 
+ * + * string instance_id = 28; + */ + java.lang.String getInstanceId(); + /** + *
+   * An identifier for the instance that handled the request.
+   * 
+ * + * string instance_id = 28; + */ + com.google.protobuf.ByteString + getInstanceIdBytes(); + + /** + *
+   * A list of log lines emitted by the application while serving this request.
+   * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + java.util.List + getLineList(); + /** + *
+   * A list of log lines emitted by the application while serving this request.
+   * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + com.google.appengine.logging.v1.LogLine getLine(int index); + /** + *
+   * A list of log lines emitted by the application while serving this request.
+   * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + int getLineCount(); + /** + *
+   * A list of log lines emitted by the application while serving this request.
+   * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + java.util.List + getLineOrBuilderList(); + /** + *
+   * A list of log lines emitted by the application while serving this request.
+   * 
+ * + * repeated .google.appengine.logging.v1.LogLine line = 29; + */ + com.google.appengine.logging.v1.LogLineOrBuilder getLineOrBuilder( + int index); + + /** + *
+   * App Engine release version.
+   * 
+ * + * string app_engine_release = 38; + */ + java.lang.String getAppEngineRelease(); + /** + *
+   * App Engine release version.
+   * 
+ * + * string app_engine_release = 38; + */ + com.google.protobuf.ByteString + getAppEngineReleaseBytes(); + + /** + *
+   * Stackdriver Trace identifier for this request.
+   * 
+ * + * string trace_id = 39; + */ + java.lang.String getTraceId(); + /** + *
+   * Stackdriver Trace identifier for this request.
+   * 
+ * + * string trace_id = 39; + */ + com.google.protobuf.ByteString + getTraceIdBytes(); + + /** + *
+   * If true, the value in the 'trace_id' field was sampled for storage in a
+   * trace backend.
+   * 
+ * + * bool trace_sampled = 43; + */ + boolean getTraceSampled(); + + /** + *
+   * Source code for the application that handled this request. There can be
+   * more than one source reference per deployed application if source code is
+   * distributed among multiple repositories.
+   * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + java.util.List + getSourceReferenceList(); + /** + *
+   * Source code for the application that handled this request. There can be
+   * more than one source reference per deployed application if source code is
+   * distributed among multiple repositories.
+   * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + com.google.appengine.logging.v1.SourceReference getSourceReference(int index); + /** + *
+   * Source code for the application that handled this request. There can be
+   * more than one source reference per deployed application if source code is
+   * distributed among multiple repositories.
+   * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + int getSourceReferenceCount(); + /** + *
+   * Source code for the application that handled this request. There can be
+   * more than one source reference per deployed application if source code is
+   * distributed among multiple repositories.
+   * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + java.util.List + getSourceReferenceOrBuilderList(); + /** + *
+   * Source code for the application that handled this request. There can be
+   * more than one source reference per deployed application if source code is
+   * distributed among multiple repositories.
+   * 
+ * + * repeated .google.appengine.logging.v1.SourceReference source_reference = 41; + */ + com.google.appengine.logging.v1.SourceReferenceOrBuilder getSourceReferenceOrBuilder( + int index); +} diff --git a/src/main/java/com/google/appengine/logging/v1/RequestLogProto.java b/src/main/java/com/google/appengine/logging/v1/RequestLogProto.java new file mode 100644 index 00000000000..fb95f5e4403 --- /dev/null +++ b/src/main/java/com/google/appengine/logging/v1/RequestLogProto.java @@ -0,0 +1,130 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/appengine/logging/v1/request_log.proto + +package com.google.appengine.logging.v1; + +public final class RequestLogProto { + private RequestLogProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_appengine_logging_v1_LogLine_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_appengine_logging_v1_LogLine_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_appengine_logging_v1_SourceLocation_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_appengine_logging_v1_SourceLocation_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_appengine_logging_v1_SourceReference_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_appengine_logging_v1_SourceReference_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_google_appengine_logging_v1_RequestLog_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_google_appengine_logging_v1_RequestLog_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n-google/appengine/logging/v1/request_lo" + + "g.proto\022\033google.appengine.logging.v1\032&go" + + "ogle/logging/type/log_severity.proto\032\036go" + + "ogle/protobuf/duration.proto\032\037google/pro" + + "tobuf/timestamp.proto\"\302\001\n\007LogLine\022(\n\004tim" + + "e\030\001 \001(\0132\032.google.protobuf.Timestamp\0222\n\010s" + + "everity\030\002 \001(\0162 .google.logging.type.LogS" + + "everity\022\023\n\013log_message\030\003 \001(\t\022D\n\017source_l" + + "ocation\030\004 \001(\0132+.google.appengine.logging" + + ".v1.SourceLocation\"C\n\016SourceLocation\022\014\n\004", + "file\030\001 \001(\t\022\014\n\004line\030\002 \001(\003\022\025\n\rfunction_nam" + + "e\030\003 \001(\t\":\n\017SourceReference\022\022\n\nrepository" + + "\030\001 \001(\t\022\023\n\013revision_id\030\002 \001(\t\"\325\006\n\nRequestL" + + "og\022\016\n\006app_id\030\001 \001(\t\022\021\n\tmodule_id\030% \001(\t\022\022\n" + + "\nversion_id\030\002 \001(\t\022\022\n\nrequest_id\030\003 \001(\t\022\n\n" + + "\002ip\030\004 \001(\t\022.\n\nstart_time\030\006 \001(\0132\032.google.p" + + "rotobuf.Timestamp\022,\n\010end_time\030\007 \001(\0132\032.go" + + "ogle.protobuf.Timestamp\022*\n\007latency\030\010 \001(\013" + + "2\031.google.protobuf.Duration\022\023\n\013mega_cycl" + + "es\030\t \001(\003\022\016\n\006method\030\n \001(\t\022\020\n\010resource\030\013 \001", + "(\t\022\024\n\014http_version\030\014 \001(\t\022\016\n\006status\030\r \001(\005" + + "\022\025\n\rresponse_size\030\016 \001(\003\022\020\n\010referrer\030\017 \001(" + + "\t\022\022\n\nuser_agent\030\020 \001(\t\022\020\n\010nickname\030( \001(\t\022" + + "\025\n\rurl_map_entry\030\021 \001(\t\022\014\n\004host\030\024 \001(\t\022\014\n\004" + + "cost\030\025 \001(\001\022\027\n\017task_queue_name\030\026 \001(\t\022\021\n\tt" + + "ask_name\030\027 \001(\t\022\033\n\023was_loading_request\030\030 " + + "\001(\010\022/\n\014pending_time\030\031 \001(\0132\031.google.proto" + + "buf.Duration\022\026\n\016instance_index\030\032 \001(\005\022\020\n\010" + + "finished\030\033 \001(\010\022\r\n\005first\030* \001(\010\022\023\n\013instanc" + + "e_id\030\034 \001(\t\0222\n\004line\030\035 \003(\0132$.google.appeng", + "ine.logging.v1.LogLine\022\032\n\022app_engine_rel" + + "ease\030& \001(\t\022\020\n\010trace_id\030\' \001(\t\022\025\n\rtrace_sa" + + "mpled\030+ \001(\010\022F\n\020source_reference\030) \003(\0132,." + + "google.appengine.logging.v1.SourceRefere" + + "nceBx\n\037com.google.appengine.logging.v1B\017" + + "RequestLogProtoP\001ZBgoogle.golang.org/gen" + + "proto/googleapis/appengine/logging/v1;lo" + + "ggingb\006proto3" + }; + com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = + new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { + public com.google.protobuf.ExtensionRegistry assignDescriptors( + com.google.protobuf.Descriptors.FileDescriptor root) { + descriptor = root; + return null; + } + }; + com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.logging.type.LogSeverityProto.getDescriptor(), + com.google.protobuf.DurationProto.getDescriptor(), + com.google.protobuf.TimestampProto.getDescriptor(), + }, assigner); + internal_static_google_appengine_logging_v1_LogLine_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_google_appengine_logging_v1_LogLine_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_appengine_logging_v1_LogLine_descriptor, + new java.lang.String[] { "Time", "Severity", "LogMessage", "SourceLocation", }); + internal_static_google_appengine_logging_v1_SourceLocation_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_google_appengine_logging_v1_SourceLocation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_appengine_logging_v1_SourceLocation_descriptor, + new java.lang.String[] { "File", "Line", "FunctionName", }); + internal_static_google_appengine_logging_v1_SourceReference_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_google_appengine_logging_v1_SourceReference_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_appengine_logging_v1_SourceReference_descriptor, + new java.lang.String[] { "Repository", "RevisionId", }); + internal_static_google_appengine_logging_v1_RequestLog_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_google_appengine_logging_v1_RequestLog_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_google_appengine_logging_v1_RequestLog_descriptor, + new java.lang.String[] { "AppId", "ModuleId", "VersionId", "RequestId", "Ip", "StartTime", "EndTime", "Latency", "MegaCycles", "Method", "Resource", "HttpVersion", "Status", "ResponseSize", "Referrer", "UserAgent", "Nickname", "UrlMapEntry", "Host", "Cost", "TaskQueueName", "TaskName", "WasLoadingRequest", "PendingTime", "InstanceIndex", "Finished", "First", "InstanceId", "Line", "AppEngineRelease", "TraceId", "TraceSampled", "SourceReference", }); + com.google.logging.type.LogSeverityProto.getDescriptor(); + com.google.protobuf.DurationProto.getDescriptor(); + com.google.protobuf.TimestampProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/src/main/java/com/google/appengine/logging/v1/SourceLocation.java b/src/main/java/com/google/appengine/logging/v1/SourceLocation.java new file mode 100644 index 00000000000..4cf5065d8bb --- /dev/null +++ b/src/main/java/com/google/appengine/logging/v1/SourceLocation.java @@ -0,0 +1,813 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/appengine/logging/v1/request_log.proto + +package com.google.appengine.logging.v1; + +/** + *
+ * Specifies a location in a source code file.
+ * 
+ * + * Protobuf type {@code google.appengine.logging.v1.SourceLocation} + */ +public final class SourceLocation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.appengine.logging.v1.SourceLocation) + SourceLocationOrBuilder { + // Use SourceLocation.newBuilder() to construct. + private SourceLocation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SourceLocation() { + file_ = ""; + line_ = 0L; + functionName_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private SourceLocation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + file_ = s; + break; + } + case 16: { + + line_ = input.readInt64(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + functionName_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_SourceLocation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_SourceLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.appengine.logging.v1.SourceLocation.class, com.google.appengine.logging.v1.SourceLocation.Builder.class); + } + + public static final int FILE_FIELD_NUMBER = 1; + private volatile java.lang.Object file_; + /** + *
+   * Source file name. Depending on the runtime environment, this might be a
+   * simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + */ + public java.lang.String getFile() { + java.lang.Object ref = file_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + file_ = s; + return s; + } + } + /** + *
+   * Source file name. Depending on the runtime environment, this might be a
+   * simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + */ + public com.google.protobuf.ByteString + getFileBytes() { + java.lang.Object ref = file_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + file_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LINE_FIELD_NUMBER = 2; + private long line_; + /** + *
+   * Line within the source file.
+   * 
+ * + * int64 line = 2; + */ + public long getLine() { + return line_; + } + + public static final int FUNCTION_NAME_FIELD_NUMBER = 3; + private volatile java.lang.Object functionName_; + /** + *
+   * Human-readable name of the function or method being invoked, with optional
+   * context such as the class or package name. This information is used in
+   * contexts such as the logs viewer, where a file and line number are less
+   * meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function_name = 3; + */ + public java.lang.String getFunctionName() { + java.lang.Object ref = functionName_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + functionName_ = s; + return s; + } + } + /** + *
+   * Human-readable name of the function or method being invoked, with optional
+   * context such as the class or package name. This information is used in
+   * contexts such as the logs viewer, where a file and line number are less
+   * meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function_name = 3; + */ + public com.google.protobuf.ByteString + getFunctionNameBytes() { + java.lang.Object ref = functionName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + functionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getFileBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, file_); + } + if (line_ != 0L) { + output.writeInt64(2, line_); + } + if (!getFunctionNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, functionName_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFileBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, file_); + } + if (line_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, line_); + } + if (!getFunctionNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, functionName_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.appengine.logging.v1.SourceLocation)) { + return super.equals(obj); + } + com.google.appengine.logging.v1.SourceLocation other = (com.google.appengine.logging.v1.SourceLocation) obj; + + boolean result = true; + result = result && getFile() + .equals(other.getFile()); + result = result && (getLine() + == other.getLine()); + result = result && getFunctionName() + .equals(other.getFunctionName()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + FILE_FIELD_NUMBER; + hash = (53 * hash) + getFile().hashCode(); + hash = (37 * hash) + LINE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLine()); + hash = (37 * hash) + FUNCTION_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFunctionName().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.appengine.logging.v1.SourceLocation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.SourceLocation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.SourceLocation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.SourceLocation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.SourceLocation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.SourceLocation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.SourceLocation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.SourceLocation parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.appengine.logging.v1.SourceLocation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.SourceLocation parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.appengine.logging.v1.SourceLocation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.SourceLocation parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.appengine.logging.v1.SourceLocation prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * Specifies a location in a source code file.
+   * 
+ * + * Protobuf type {@code google.appengine.logging.v1.SourceLocation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.appengine.logging.v1.SourceLocation) + com.google.appengine.logging.v1.SourceLocationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_SourceLocation_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_SourceLocation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.appengine.logging.v1.SourceLocation.class, com.google.appengine.logging.v1.SourceLocation.Builder.class); + } + + // Construct using com.google.appengine.logging.v1.SourceLocation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + file_ = ""; + + line_ = 0L; + + functionName_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_SourceLocation_descriptor; + } + + public com.google.appengine.logging.v1.SourceLocation getDefaultInstanceForType() { + return com.google.appengine.logging.v1.SourceLocation.getDefaultInstance(); + } + + public com.google.appengine.logging.v1.SourceLocation build() { + com.google.appengine.logging.v1.SourceLocation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.appengine.logging.v1.SourceLocation buildPartial() { + com.google.appengine.logging.v1.SourceLocation result = new com.google.appengine.logging.v1.SourceLocation(this); + result.file_ = file_; + result.line_ = line_; + result.functionName_ = functionName_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.appengine.logging.v1.SourceLocation) { + return mergeFrom((com.google.appengine.logging.v1.SourceLocation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.appengine.logging.v1.SourceLocation other) { + if (other == com.google.appengine.logging.v1.SourceLocation.getDefaultInstance()) return this; + if (!other.getFile().isEmpty()) { + file_ = other.file_; + onChanged(); + } + if (other.getLine() != 0L) { + setLine(other.getLine()); + } + if (!other.getFunctionName().isEmpty()) { + functionName_ = other.functionName_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.appengine.logging.v1.SourceLocation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.appengine.logging.v1.SourceLocation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object file_ = ""; + /** + *
+     * Source file name. Depending on the runtime environment, this might be a
+     * simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + */ + public java.lang.String getFile() { + java.lang.Object ref = file_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + file_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Source file name. Depending on the runtime environment, this might be a
+     * simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + */ + public com.google.protobuf.ByteString + getFileBytes() { + java.lang.Object ref = file_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + file_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Source file name. Depending on the runtime environment, this might be a
+     * simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + */ + public Builder setFile( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + file_ = value; + onChanged(); + return this; + } + /** + *
+     * Source file name. Depending on the runtime environment, this might be a
+     * simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + */ + public Builder clearFile() { + + file_ = getDefaultInstance().getFile(); + onChanged(); + return this; + } + /** + *
+     * Source file name. Depending on the runtime environment, this might be a
+     * simple name or a fully-qualified name.
+     * 
+ * + * string file = 1; + */ + public Builder setFileBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + file_ = value; + onChanged(); + return this; + } + + private long line_ ; + /** + *
+     * Line within the source file.
+     * 
+ * + * int64 line = 2; + */ + public long getLine() { + return line_; + } + /** + *
+     * Line within the source file.
+     * 
+ * + * int64 line = 2; + */ + public Builder setLine(long value) { + + line_ = value; + onChanged(); + return this; + } + /** + *
+     * Line within the source file.
+     * 
+ * + * int64 line = 2; + */ + public Builder clearLine() { + + line_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object functionName_ = ""; + /** + *
+     * Human-readable name of the function or method being invoked, with optional
+     * context such as the class or package name. This information is used in
+     * contexts such as the logs viewer, where a file and line number are less
+     * meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function_name = 3; + */ + public java.lang.String getFunctionName() { + java.lang.Object ref = functionName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + functionName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Human-readable name of the function or method being invoked, with optional
+     * context such as the class or package name. This information is used in
+     * contexts such as the logs viewer, where a file and line number are less
+     * meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function_name = 3; + */ + public com.google.protobuf.ByteString + getFunctionNameBytes() { + java.lang.Object ref = functionName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + functionName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Human-readable name of the function or method being invoked, with optional
+     * context such as the class or package name. This information is used in
+     * contexts such as the logs viewer, where a file and line number are less
+     * meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function_name = 3; + */ + public Builder setFunctionName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + functionName_ = value; + onChanged(); + return this; + } + /** + *
+     * Human-readable name of the function or method being invoked, with optional
+     * context such as the class or package name. This information is used in
+     * contexts such as the logs viewer, where a file and line number are less
+     * meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function_name = 3; + */ + public Builder clearFunctionName() { + + functionName_ = getDefaultInstance().getFunctionName(); + onChanged(); + return this; + } + /** + *
+     * Human-readable name of the function or method being invoked, with optional
+     * context such as the class or package name. This information is used in
+     * contexts such as the logs viewer, where a file and line number are less
+     * meaningful. The format can vary by language. For example:
+     * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+     * (Python).
+     * 
+ * + * string function_name = 3; + */ + public Builder setFunctionNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + functionName_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.appengine.logging.v1.SourceLocation) + } + + // @@protoc_insertion_point(class_scope:google.appengine.logging.v1.SourceLocation) + private static final com.google.appengine.logging.v1.SourceLocation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.appengine.logging.v1.SourceLocation(); + } + + public static com.google.appengine.logging.v1.SourceLocation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public SourceLocation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SourceLocation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.appengine.logging.v1.SourceLocation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/appengine/logging/v1/SourceLocationOrBuilder.java b/src/main/java/com/google/appengine/logging/v1/SourceLocationOrBuilder.java new file mode 100644 index 00000000000..4111fd5b22c --- /dev/null +++ b/src/main/java/com/google/appengine/logging/v1/SourceLocationOrBuilder.java @@ -0,0 +1,66 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/appengine/logging/v1/request_log.proto + +package com.google.appengine.logging.v1; + +public interface SourceLocationOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.appengine.logging.v1.SourceLocation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Source file name. Depending on the runtime environment, this might be a
+   * simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + */ + java.lang.String getFile(); + /** + *
+   * Source file name. Depending on the runtime environment, this might be a
+   * simple name or a fully-qualified name.
+   * 
+ * + * string file = 1; + */ + com.google.protobuf.ByteString + getFileBytes(); + + /** + *
+   * Line within the source file.
+   * 
+ * + * int64 line = 2; + */ + long getLine(); + + /** + *
+   * Human-readable name of the function or method being invoked, with optional
+   * context such as the class or package name. This information is used in
+   * contexts such as the logs viewer, where a file and line number are less
+   * meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function_name = 3; + */ + java.lang.String getFunctionName(); + /** + *
+   * Human-readable name of the function or method being invoked, with optional
+   * context such as the class or package name. This information is used in
+   * contexts such as the logs viewer, where a file and line number are less
+   * meaningful. The format can vary by language. For example:
+   * `qual.if.ied.Class.method` (Java), `dir/package.func` (Go), `function`
+   * (Python).
+   * 
+ * + * string function_name = 3; + */ + com.google.protobuf.ByteString + getFunctionNameBytes(); +} diff --git a/src/main/java/com/google/appengine/logging/v1/SourceReference.java b/src/main/java/com/google/appengine/logging/v1/SourceReference.java new file mode 100644 index 00000000000..03188a3c313 --- /dev/null +++ b/src/main/java/com/google/appengine/logging/v1/SourceReference.java @@ -0,0 +1,712 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/appengine/logging/v1/request_log.proto + +package com.google.appengine.logging.v1; + +/** + *
+ * A reference to a particular snapshot of the source tree used to build and
+ * deploy an application.
+ * 
+ * + * Protobuf type {@code google.appengine.logging.v1.SourceReference} + */ +public final class SourceReference extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:google.appengine.logging.v1.SourceReference) + SourceReferenceOrBuilder { + // Use SourceReference.newBuilder() to construct. + private SourceReference(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SourceReference() { + repository_ = ""; + revisionId_ = ""; + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return com.google.protobuf.UnknownFieldSet.getDefaultInstance(); + } + private SourceReference( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + int mutable_bitField0_ = 0; + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + default: { + if (!input.skipField(tag)) { + done = true; + } + break; + } + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + repository_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + revisionId_ = s; + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_SourceReference_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_SourceReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.appengine.logging.v1.SourceReference.class, com.google.appengine.logging.v1.SourceReference.Builder.class); + } + + public static final int REPOSITORY_FIELD_NUMBER = 1; + private volatile java.lang.Object repository_; + /** + *
+   * Optional. A URI string identifying the repository.
+   * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
+   * 
+ * + * string repository = 1; + */ + public java.lang.String getRepository() { + java.lang.Object ref = repository_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repository_ = s; + return s; + } + } + /** + *
+   * Optional. A URI string identifying the repository.
+   * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
+   * 
+ * + * string repository = 1; + */ + public com.google.protobuf.ByteString + getRepositoryBytes() { + java.lang.Object ref = repository_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + repository_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REVISION_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object revisionId_; + /** + *
+   * The canonical and persistent identifier of the deployed revision.
+   * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
+   * 
+ * + * string revision_id = 2; + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revisionId_ = s; + return s; + } + } + /** + *
+   * The canonical and persistent identifier of the deployed revision.
+   * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
+   * 
+ * + * string revision_id = 2; + */ + public com.google.protobuf.ByteString + getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!getRepositoryBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, repository_); + } + if (!getRevisionIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, revisionId_); + } + } + + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getRepositoryBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, repository_); + } + if (!getRevisionIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, revisionId_); + } + memoizedSize = size; + return size; + } + + private static final long serialVersionUID = 0L; + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof com.google.appengine.logging.v1.SourceReference)) { + return super.equals(obj); + } + com.google.appengine.logging.v1.SourceReference other = (com.google.appengine.logging.v1.SourceReference) obj; + + boolean result = true; + result = result && getRepository() + .equals(other.getRepository()); + result = result && getRevisionId() + .equals(other.getRevisionId()); + return result; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + REPOSITORY_FIELD_NUMBER; + hash = (53 * hash) + getRepository().hashCode(); + hash = (37 * hash) + REVISION_ID_FIELD_NUMBER; + hash = (53 * hash) + getRevisionId().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static com.google.appengine.logging.v1.SourceReference parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.SourceReference parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.SourceReference parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.SourceReference parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.SourceReference parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static com.google.appengine.logging.v1.SourceReference parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static com.google.appengine.logging.v1.SourceReference parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.SourceReference parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.appengine.logging.v1.SourceReference parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.SourceReference parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static com.google.appengine.logging.v1.SourceReference parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static com.google.appengine.logging.v1.SourceReference parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(com.google.appengine.logging.v1.SourceReference prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + *
+   * A reference to a particular snapshot of the source tree used to build and
+   * deploy an application.
+   * 
+ * + * Protobuf type {@code google.appengine.logging.v1.SourceReference} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:google.appengine.logging.v1.SourceReference) + com.google.appengine.logging.v1.SourceReferenceOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_SourceReference_descriptor; + } + + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_SourceReference_fieldAccessorTable + .ensureFieldAccessorsInitialized( + com.google.appengine.logging.v1.SourceReference.class, com.google.appengine.logging.v1.SourceReference.Builder.class); + } + + // Construct using com.google.appengine.logging.v1.SourceReference.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + public Builder clear() { + super.clear(); + repository_ = ""; + + revisionId_ = ""; + + return this; + } + + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return com.google.appengine.logging.v1.RequestLogProto.internal_static_google_appengine_logging_v1_SourceReference_descriptor; + } + + public com.google.appengine.logging.v1.SourceReference getDefaultInstanceForType() { + return com.google.appengine.logging.v1.SourceReference.getDefaultInstance(); + } + + public com.google.appengine.logging.v1.SourceReference build() { + com.google.appengine.logging.v1.SourceReference result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + public com.google.appengine.logging.v1.SourceReference buildPartial() { + com.google.appengine.logging.v1.SourceReference result = new com.google.appengine.logging.v1.SourceReference(this); + result.repository_ = repository_; + result.revisionId_ = revisionId_; + onBuilt(); + return result; + } + + public Builder clone() { + return (Builder) super.clone(); + } + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.setField(field, value); + } + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return (Builder) super.clearField(field); + } + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return (Builder) super.clearOneof(oneof); + } + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, Object value) { + return (Builder) super.setRepeatedField(field, index, value); + } + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + Object value) { + return (Builder) super.addRepeatedField(field, value); + } + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof com.google.appengine.logging.v1.SourceReference) { + return mergeFrom((com.google.appengine.logging.v1.SourceReference)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(com.google.appengine.logging.v1.SourceReference other) { + if (other == com.google.appengine.logging.v1.SourceReference.getDefaultInstance()) return this; + if (!other.getRepository().isEmpty()) { + repository_ = other.repository_; + onChanged(); + } + if (!other.getRevisionId().isEmpty()) { + revisionId_ = other.revisionId_; + onChanged(); + } + onChanged(); + return this; + } + + public final boolean isInitialized() { + return true; + } + + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + com.google.appengine.logging.v1.SourceReference parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (com.google.appengine.logging.v1.SourceReference) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object repository_ = ""; + /** + *
+     * Optional. A URI string identifying the repository.
+     * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
+     * 
+ * + * string repository = 1; + */ + public java.lang.String getRepository() { + java.lang.Object ref = repository_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + repository_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * Optional. A URI string identifying the repository.
+     * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
+     * 
+ * + * string repository = 1; + */ + public com.google.protobuf.ByteString + getRepositoryBytes() { + java.lang.Object ref = repository_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + repository_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * Optional. A URI string identifying the repository.
+     * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
+     * 
+ * + * string repository = 1; + */ + public Builder setRepository( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + repository_ = value; + onChanged(); + return this; + } + /** + *
+     * Optional. A URI string identifying the repository.
+     * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
+     * 
+ * + * string repository = 1; + */ + public Builder clearRepository() { + + repository_ = getDefaultInstance().getRepository(); + onChanged(); + return this; + } + /** + *
+     * Optional. A URI string identifying the repository.
+     * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
+     * 
+ * + * string repository = 1; + */ + public Builder setRepositoryBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + repository_ = value; + onChanged(); + return this; + } + + private java.lang.Object revisionId_ = ""; + /** + *
+     * The canonical and persistent identifier of the deployed revision.
+     * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
+     * 
+ * + * string revision_id = 2; + */ + public java.lang.String getRevisionId() { + java.lang.Object ref = revisionId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + revisionId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+     * The canonical and persistent identifier of the deployed revision.
+     * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
+     * 
+ * + * string revision_id = 2; + */ + public com.google.protobuf.ByteString + getRevisionIdBytes() { + java.lang.Object ref = revisionId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + revisionId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+     * The canonical and persistent identifier of the deployed revision.
+     * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
+     * 
+ * + * string revision_id = 2; + */ + public Builder setRevisionId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + revisionId_ = value; + onChanged(); + return this; + } + /** + *
+     * The canonical and persistent identifier of the deployed revision.
+     * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
+     * 
+ * + * string revision_id = 2; + */ + public Builder clearRevisionId() { + + revisionId_ = getDefaultInstance().getRevisionId(); + onChanged(); + return this; + } + /** + *
+     * The canonical and persistent identifier of the deployed revision.
+     * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
+     * 
+ * + * string revision_id = 2; + */ + public Builder setRevisionIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + revisionId_ = value; + onChanged(); + return this; + } + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return this; + } + + + // @@protoc_insertion_point(builder_scope:google.appengine.logging.v1.SourceReference) + } + + // @@protoc_insertion_point(class_scope:google.appengine.logging.v1.SourceReference) + private static final com.google.appengine.logging.v1.SourceReference DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new com.google.appengine.logging.v1.SourceReference(); + } + + public static com.google.appengine.logging.v1.SourceReference getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + public SourceReference parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SourceReference(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + public com.google.appengine.logging.v1.SourceReference getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/src/main/java/com/google/appengine/logging/v1/SourceReferenceOrBuilder.java b/src/main/java/com/google/appengine/logging/v1/SourceReferenceOrBuilder.java new file mode 100644 index 00000000000..23c66f9c0d4 --- /dev/null +++ b/src/main/java/com/google/appengine/logging/v1/SourceReferenceOrBuilder.java @@ -0,0 +1,49 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: google/appengine/logging/v1/request_log.proto + +package com.google.appengine.logging.v1; + +public interface SourceReferenceOrBuilder extends + // @@protoc_insertion_point(interface_extends:google.appengine.logging.v1.SourceReference) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Optional. A URI string identifying the repository.
+   * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
+   * 
+ * + * string repository = 1; + */ + java.lang.String getRepository(); + /** + *
+   * Optional. A URI string identifying the repository.
+   * Example: "https://github.com/GoogleCloudPlatform/kubernetes.git"
+   * 
+ * + * string repository = 1; + */ + com.google.protobuf.ByteString + getRepositoryBytes(); + + /** + *
+   * The canonical and persistent identifier of the deployed revision.
+   * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
+   * 
+ * + * string revision_id = 2; + */ + java.lang.String getRevisionId(); + /** + *
+   * The canonical and persistent identifier of the deployed revision.
+   * Example (git): "0035781c50ec7aa23385dc841529ce8a4b70db1b"
+   * 
+ * + * string revision_id = 2; + */ + com.google.protobuf.ByteString + getRevisionIdBytes(); +} diff --git a/src/main/java/teammates/common/util/Config.java b/src/main/java/teammates/common/util/Config.java index 8f0d83a1300..90d1808fcb1 100644 --- a/src/main/java/teammates/common/util/Config.java +++ b/src/main/java/teammates/common/util/Config.java @@ -21,12 +21,18 @@ public final class Config { /** The value of the "app.id" in build.properties file. */ public static final String APP_ID; + /** The value of the "app.region" in build.properties file. */ + public static final String APP_REGION; + /** The value of the "app.version" in build.properties file. */ public static final String APP_VERSION; /** The value of the "app.frontenddev.url" in build.properties file. */ public static final String APP_FRONTENDDEV_URL; + /** The value of the "app.taskqueue.active" in build.properties file. */ + public static final boolean TASKQUEUE_ACTIVE; + /** The value of the "app.production.gcs.bucketname" in build.properties file. */ public static final String PRODUCTION_GCS_BUCKETNAME; @@ -90,8 +96,10 @@ public final class Config { Assumption.fail(TeammatesException.toStringWithStackTrace(e)); } APP_ID = properties.getProperty("app.id"); + APP_REGION = properties.getProperty("app.region"); APP_VERSION = properties.getProperty("app.version").replace("-", "."); APP_FRONTENDDEV_URL = properties.getProperty("app.frontenddev.url"); + TASKQUEUE_ACTIVE = Boolean.parseBoolean(properties.getProperty("app.taskqueue.active", "true")); CSRF_KEY = properties.getProperty("app.csrf.key"); BACKDOOR_KEY = properties.getProperty("app.backdoor.key"); PRODUCTION_GCS_BUCKETNAME = properties.getProperty("app.production.gcs.bucketname"); diff --git a/src/main/java/teammates/logic/api/EmailGenerator.java b/src/main/java/teammates/logic/api/EmailGenerator.java index bf8db61c2c9..24033043023 100644 --- a/src/main/java/teammates/logic/api/EmailGenerator.java +++ b/src/main/java/teammates/logic/api/EmailGenerator.java @@ -8,8 +8,6 @@ import java.util.Map; import java.util.stream.Collectors; -import com.google.appengine.api.log.AppLogLine; - import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; @@ -799,10 +797,10 @@ private String fillUpInstructorRejoinAfterGoogleIdResetFragment( /** * Generates the logs compilation email for the given {@code logs}. */ - public EmailWrapper generateCompiledLogsEmail(List logs) { + public EmailWrapper generateCompiledLogsEmail(List logMessages, List logLevels) { StringBuilder emailBody = new StringBuilder(); - for (int i = 0; i < logs.size(); i++) { - emailBody.append(generateSevereErrorLogLine(i, logs.get(i))); + for (int i = 0; i < logMessages.size(); i++) { + emailBody.append(generateSevereErrorLogLine(i, logMessages.get(i), logLevels.get(i))); } EmailWrapper email = getEmptyEmailAddressedToEmail(Config.SUPPORT_EMAIL); @@ -811,12 +809,12 @@ public EmailWrapper generateCompiledLogsEmail(List logs) { return email; } - private String generateSevereErrorLogLine(int index, AppLogLine logLine) { + private String generateSevereErrorLogLine(int index, String logMessage, String logLevel) { return Templates.populateTemplate( EmailTemplates.SEVERE_ERROR_LOG_LINE, "${index}", String.valueOf(index), - "${errorType}", logLine.getLogLevel().toString(), - "${errorMessage}", logLine.getLogMessage().replace("\n", "
")); + "${errorType}", logLevel, + "${errorMessage}", logMessage); } private EmailWrapper getEmptyEmailAddressedToEmail(String recipient) { diff --git a/src/main/java/teammates/logic/core/TaskQueuesLogic.java b/src/main/java/teammates/logic/core/TaskQueuesLogic.java index b1862630b65..6a449fb9542 100644 --- a/src/main/java/teammates/logic/core/TaskQueuesLogic.java +++ b/src/main/java/teammates/logic/core/TaskQueuesLogic.java @@ -1,10 +1,36 @@ package teammates.logic.core; -import com.google.appengine.api.taskqueue.Queue; -import com.google.appengine.api.taskqueue.QueueFactory; -import com.google.appengine.api.taskqueue.TaskOptions; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.charset.Charset; +import java.time.Instant; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.apache.http.NameValuePair; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; + +import com.google.cloud.tasks.v2.AppEngineHttpRequest; +import com.google.cloud.tasks.v2.CloudTasksClient; +import com.google.cloud.tasks.v2.HttpMethod; +import com.google.cloud.tasks.v2.QueueName; +import com.google.cloud.tasks.v2.Task; +import com.google.protobuf.ByteString; +import com.google.protobuf.Timestamp; + +import teammates.common.exception.TeammatesException; +import teammates.common.util.AppUrl; +import teammates.common.util.Config; +import teammates.common.util.Const; import teammates.common.util.JsonUtils; +import teammates.common.util.Logger; import teammates.common.util.TaskWrapper; /** @@ -12,6 +38,8 @@ */ public class TaskQueuesLogic { + private static final Logger log = Logger.getLogger(); + /** * Adds the given task to the specified queue. * @@ -28,20 +56,79 @@ public void addTask(TaskWrapper task) { * @param countdownTime the time delay for the task to be executed */ public void addDeferredTask(TaskWrapper task, long countdownTime) { - Queue requiredQueue = QueueFactory.getQueue(task.getQueueName()); - TaskOptions taskToBeAdded = TaskOptions.Builder.withUrl(task.getWorkerUrl()); - if (countdownTime > 0) { - taskToBeAdded.countdownMillis(countdownTime); + if (Config.isDevServer()) { + // In dev server, task queues are either not active (i.e. they will not be executed even if queued) + // or they will be executed immediately without going through any kind of "queue" + + if (!Config.TASKQUEUE_ACTIVE) { + return; + } + HttpPost post = new HttpPost(createBasicUri( + "http://localhost:8080" + task.getWorkerUrl(), task.getParamMap())); + + if (task.getRequestBody() != null) { + StringEntity entity = new StringEntity( + JsonUtils.toCompactJson(task.getRequestBody()), Charset.forName(Const.ENCODING)); + post.setEntity(entity); + } + + post.addHeader("X-AppEngine-QueueName", task.getQueueName()); + post.addHeader("X-Google-DevAppserver-SkipAdminCheck", "true"); + + try (CloseableHttpClient httpClient = HttpClients.createDefault()) { + httpClient.execute(post); + } catch (IOException e) { + log.severe("Error when executing HTTP request: " + TeammatesException.toStringWithStackTrace(e)); + } + return; } - // GAE's Task Queue API only allows either parameter map or body, not both - if (task.getRequestBody() == null) { - task.getParamMap().forEach((key, value) -> taskToBeAdded.param(key, value)); - } else { - taskToBeAdded.payload(JsonUtils.toCompactJson(task.getRequestBody())); + try (CloudTasksClient client = CloudTasksClient.create()) { + String queuePath = QueueName.of(Config.APP_ID, Config.APP_REGION, task.getQueueName()).toString(); + + AppEngineHttpRequest.Builder requestBuilder = + AppEngineHttpRequest.newBuilder() + .setHttpMethod(HttpMethod.POST); + + if (task.getRequestBody() == null) { + String relativeUrl = "http://place.holder"; // the value is not important + AppUrl url = new AppUrl(relativeUrl + task.getWorkerUrl()); + task.getParamMap().forEach((key, value) -> url.withParam(key, value)); + + requestBuilder.setRelativeUri(url.toString()); + } else { + String requestBody = JsonUtils.toCompactJson(task.getRequestBody()); + requestBuilder.setRelativeUri(task.getWorkerUrl()) + .setBody(ByteString.copyFrom(requestBody, Charset.forName(Const.ENCODING))); + } + + Task.Builder taskBuilder = Task.newBuilder().setAppEngineHttpRequest(requestBuilder.build()); + if (countdownTime > 0) { + taskBuilder.setScheduleTime( + Timestamp.newBuilder() + .setSeconds(Instant.now().plusMillis(countdownTime).getEpochSecond())); + } + + client.createTask(queuePath, taskBuilder.build()); + } catch (IOException e) { + log.severe("Cannot create Cloud Tasks client: " + TeammatesException.toStringWithStackTrace(e)); + } + } + + private static URI createBasicUri(String url, Map params) { + List postParameters = new ArrayList<>(); + if (params != null) { + params.forEach((key, value) -> postParameters.add(new BasicNameValuePair(key, value))); } - requiredQueue.add(taskToBeAdded); + try { + URIBuilder uriBuilder = new URIBuilder(url); + uriBuilder.addParameters(postParameters); + + return uriBuilder.build(); + } catch (URISyntaxException e) { + return null; + } } } diff --git a/src/main/java/teammates/ui/webapi/CompileLogsAction.java b/src/main/java/teammates/ui/webapi/CompileLogsAction.java index 9d07f6bd557..b097f8ec836 100644 --- a/src/main/java/teammates/ui/webapi/CompileLogsAction.java +++ b/src/main/java/teammates/ui/webapi/CompileLogsAction.java @@ -2,15 +2,25 @@ import java.time.Instant; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; +import java.util.stream.Collectors; -import com.google.appengine.api.log.AppLogLine; -import com.google.appengine.api.log.LogQuery; -import com.google.appengine.api.log.LogService; -import com.google.appengine.api.log.LogService.LogLevel; -import com.google.appengine.api.log.LogServiceFactory; -import com.google.appengine.api.log.RequestLogs; +import com.google.api.gax.paging.Page; +import com.google.appengine.logging.v1.LogLine; +import com.google.appengine.logging.v1.RequestLog; +import com.google.appengine.logging.v1.SourceLocation; +import com.google.appengine.logging.v1.SourceReference; +import com.google.cloud.logging.LogEntry; +import com.google.cloud.logging.Logging; +import com.google.cloud.logging.Logging.EntryListOption; +import com.google.cloud.logging.LoggingOptions; +import com.google.logging.type.LogSeverity; +import com.google.protobuf.Any; +import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.util.JsonFormat; +import teammates.common.util.Config; import teammates.common.util.EmailWrapper; /** @@ -20,47 +30,83 @@ class CompileLogsAction extends AdminOnlyAction { @Override JsonResult execute() { - List errorLogs = getErrorLogs(); + List errorLogs = getErrorLogs(); sendEmail(errorLogs); return new JsonResult("Successful"); } - private List getErrorLogs() { - LogService logService = LogServiceFactory.getLogService(); + private List getErrorLogs() { + if (Config.isDevServer()) { + // Not supported in dev server + return new ArrayList<>(); + } + LoggingOptions options = LoggingOptions.getDefaultInstance(); + Logging logging = options.getService(); - long endTime = Instant.now().toEpochMilli(); + Instant endTime = Instant.now(); // Sets the range to 6 minutes to slightly overlap the 5 minute email timer long queryRange = 1000 * 60 * 6; - long startTime = endTime - queryRange; + Instant startTime = endTime.minusMillis(queryRange); + + List logOptions = Arrays.asList( + "resource.type=\"gae_app\"", + "resource.labels.module_id=\"default\"", + "logName=\"projects/" + options.getProjectId() + "/logs/appengine.googleapis.com%2Frequest_log\"", + "severity>=ERROR", + "timestamp>\"" + startTime.toString() + "\"", + "timestamp<=\"" + endTime.toString() + "\"" + ); + + List logs = new ArrayList<>(); + Page entries = logging.listLogEntries( + EntryListOption.filter(logOptions.stream().collect(Collectors.joining("\n"))) + ); + + for (LogEntry logEntry : entries.iterateAll()) { + logs.add(logEntry); + } + + return logs; + } + + private void sendEmail(List logs) { + List logMessages = new ArrayList<>(); + List logLevels = new ArrayList<>(); + + for (LogEntry logEntry : logs) { + Any entry = (Any) logEntry.getPayload().getData(); - LogQuery q = LogQuery.Builder.withDefaults() - .includeAppLogs(true) - .startTimeMillis(startTime) - .endTimeMillis(endTime) - .minLogLevel(LogLevel.ERROR); + JsonFormat.TypeRegistry tr = JsonFormat.TypeRegistry.newBuilder() + .add(RequestLog.getDescriptor()) + .add(LogLine.getDescriptor()) + .add(SourceLocation.getDescriptor()) + .add(SourceReference.getDescriptor()) + .build(); - Iterable logs = logService.fetch(q); - List errorLogs = new ArrayList<>(); + List logLines = new ArrayList<>(); + try { + String logContentAsJson = JsonFormat.printer().usingTypeRegistry(tr).print(entry); - for (RequestLogs requestLogs : logs) { - List logList = requestLogs.getAppLogLines(); + RequestLog.Builder builder = RequestLog.newBuilder(); + JsonFormat.parser().ignoringUnknownFields().usingTypeRegistry(tr).merge(logContentAsJson, builder); + RequestLog reconvertedLog = builder.build(); - for (AppLogLine currentLog : logList) { - LogLevel logLevel = currentLog.getLogLevel(); + logLines = reconvertedLog.getLineList(); + } catch (InvalidProtocolBufferException e) { + // TODO + } - if (LogLevel.FATAL == logLevel || LogLevel.ERROR == logLevel) { - errorLogs.add(currentLog); + for (LogLine line : logLines) { + if (line.getSeverity() == LogSeverity.ERROR || line.getSeverity() == LogSeverity.CRITICAL) { + logMessages.add(line.getLogMessage().replaceAll("\n", "\n
")); + logLevels.add(line.getSeverity().toString()); } } } - return errorLogs; - } - - private void sendEmail(List logs) { // Do not send any emails if there are no severe logs; prevents spamming - if (!logs.isEmpty()) { - EmailWrapper message = emailGenerator.generateCompiledLogsEmail(logs); + if (!logMessages.isEmpty()) { + EmailWrapper message = emailGenerator.generateCompiledLogsEmail(logMessages, logLevels); emailSender.sendReport(message); } } diff --git a/src/main/resources/build.template.properties b/src/main/resources/build.template.properties index 2952b47dc0a..d0cb3226959 100644 --- a/src/main/resources/build.template.properties +++ b/src/main/resources/build.template.properties @@ -9,6 +9,11 @@ # For staging server, this must match the ID of the app your created on GAE. app.id = teammates-john +# This is the deployment region of the app. +# For dev server, this could be anything. +# For staging/production server, this must match the region of your GAE application. +app.region=us-central1 + # This is the version number of the app. # Use dashes instead of dots because GAE does not allow dots in version number. # e.g. app.version = 7-0-0 @@ -18,6 +23,11 @@ app.version = 7-0-0 # This should be used only during development mode where the dev server needs to be whitelisted for CORS. app.frontenddev.url=http\://localhost:4200 +# This indicates whether task queues are active (e.g. items added to task queue will be queued for execution). +# This flag is only used during development mode; in production, task queue will always be active. +# In addition, during development mode, there is no "queueing", i.e. all tasks will be immediately executed. +app.taskqueue.active=true + # This is the Google Cloud Storage bucket name used by the app for production purposes, e.g. user profile pictures. # For dev server, any name will do. # For staging server, if you use the default bucket for your project, it should be .appspot.com diff --git a/src/test/java/teammates/architecture/ArchitectureTest.java b/src/test/java/teammates/architecture/ArchitectureTest.java index 66f720332e9..eeda64c4a83 100644 --- a/src/test/java/teammates/architecture/ArchitectureTest.java +++ b/src/test/java/teammates/architecture/ArchitectureTest.java @@ -480,9 +480,9 @@ public boolean apply(JavaClass input) { } @Test - public void testArchitecture_externalApi_taskQueueApiCanOnlyBeAccessedByTaskQueueLogic() { + public void testArchitecture_externalApi_cloudTasksApiCanOnlyBeAccessedByTaskQueueLogic() { noClasses().that().doNotHaveSimpleName("TaskQueuesLogic") - .should().accessClassesThat().resideInAPackage("com.google.appengine.api.taskqueue..") + .should().accessClassesThat().resideInAPackage("com.google.cloud.tasks.v2..") .check(ALL_CLASSES); } diff --git a/src/test/java/teammates/logic/api/EmailGeneratorTest.java b/src/test/java/teammates/logic/api/EmailGeneratorTest.java index 5a095371d29..64bf70a7b7b 100644 --- a/src/test/java/teammates/logic/api/EmailGeneratorTest.java +++ b/src/test/java/teammates/logic/api/EmailGeneratorTest.java @@ -7,9 +7,6 @@ import org.testng.annotations.Test; -import com.google.appengine.api.log.AppLogLine; -import com.google.appengine.api.log.LogService.LogLevel; - import teammates.common.datatransfer.attributes.AccountAttributes; import teammates.common.datatransfer.attributes.CourseAttributes; import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; @@ -566,16 +563,13 @@ public void testGenerateUserCourseRegisterEmail() throws IOException { @Test public void testGenerateCompiledLogsEmail() throws IOException { - AppLogLine typicalLogLine = new AppLogLine(); - typicalLogLine.setLogLevel(LogLevel.ERROR); - typicalLogLine.setLogMessage("Typical log message"); - - AppLogLine logLineWithLineBreak = new AppLogLine(); - logLineWithLineBreak.setLogLevel(LogLevel.ERROR); - logLineWithLineBreak.setLogMessage("Log line \n with line break
and also HTML br tag"); + List logMessages = Arrays.asList( + "Typical log message", + "Log line
with line break
and also HTML br tag" + ); + List logLevels = Arrays.asList("ERROR", "ERROR"); - EmailWrapper email = new EmailGenerator().generateCompiledLogsEmail( - Arrays.asList(typicalLogLine, logLineWithLineBreak)); + EmailWrapper email = new EmailGenerator().generateCompiledLogsEmail(logMessages, logLevels); String subject = String.format(EmailType.SEVERE_LOGS_COMPILATION.getSubject(), Config.APP_VERSION); diff --git a/src/test/java/teammates/test/GaeSimulation.java b/src/test/java/teammates/test/GaeSimulation.java index 2907701e4a1..de18712cb22 100644 --- a/src/test/java/teammates/test/GaeSimulation.java +++ b/src/test/java/teammates/test/GaeSimulation.java @@ -11,12 +11,10 @@ import javax.servlet.http.Part; import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig; -import com.google.appengine.tools.development.testing.LocalLogServiceTestConfig; import com.google.appengine.tools.development.testing.LocalMailServiceTestConfig; import com.google.appengine.tools.development.testing.LocalModulesServiceTestConfig; import com.google.appengine.tools.development.testing.LocalSearchServiceTestConfig; import com.google.appengine.tools.development.testing.LocalServiceTestHelper; -import com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig; import com.google.appengine.tools.development.testing.LocalUserServiceTestConfig; import teammates.common.datatransfer.UserInfo; @@ -37,8 +35,6 @@ public class GaeSimulation { // This can be any valid URL; it is not used beyond validation private static final String SIMULATION_BASE_URL = "http://localhost:8080"; - private static final String QUEUE_XML_PATH = "src/main/webapp/WEB-INF/queue.xml"; - private static GateKeeper gateKeeper = new GateKeeper(); private static GaeSimulation instance = new GaeSimulation(); @@ -58,18 +54,13 @@ public void setup() { synchronized (this) { System.out.println("Setting up GAE simulation"); - LocalTaskQueueTestConfig localTasks = new LocalTaskQueueTestConfig(); - localTasks.setQueueXmlPath(QUEUE_XML_PATH); - LocalUserServiceTestConfig localUserServices = new LocalUserServiceTestConfig(); LocalDatastoreServiceTestConfig localDatastore = new LocalDatastoreServiceTestConfig(); LocalMailServiceTestConfig localMail = new LocalMailServiceTestConfig(); LocalSearchServiceTestConfig localSearch = new LocalSearchServiceTestConfig(); localSearch.setPersistent(false); LocalModulesServiceTestConfig localModules = new LocalModulesServiceTestConfig(); - LocalLogServiceTestConfig localLog = new LocalLogServiceTestConfig(); - helper = new LocalServiceTestHelper(localDatastore, localMail, localUserServices, - localTasks, localSearch, localModules, localLog); + helper = new LocalServiceTestHelper(localDatastore, localMail, localUserServices, localSearch, localModules); helper.setEnvAttributes(getEnvironmentAttributesWithApplicationHostname()); helper.setUp(); diff --git a/static-analysis/teammates-checkstyle-suppressions.xml b/static-analysis/teammates-checkstyle-suppressions.xml index ed50967bab6..53a4d5616ff 100644 --- a/static-analysis/teammates-checkstyle-suppressions.xml +++ b/static-analysis/teammates-checkstyle-suppressions.xml @@ -3,6 +3,9 @@ "-//Checkstyle//DTD SuppressionFilter Configuration 1.1//EN" "https://checkstyle.org/dtds/suppressions_1_1.dtd"> + + + diff --git a/static-analysis/teammates-pmd.xml b/static-analysis/teammates-pmd.xml index 3e6b509fd4d..957bb4fecf4 100644 --- a/static-analysis/teammates-pmd.xml +++ b/static-analysis/teammates-pmd.xml @@ -6,6 +6,7 @@ This is the PMD ruleset for all TEAMMATES Java code. + .*/com/google/appengine/logging/v1/.* .*.html .*.xml diff --git a/static-analysis/teammates-pmdMain.xml b/static-analysis/teammates-pmdMain.xml index 440c192116d..012da269726 100644 --- a/static-analysis/teammates-pmdMain.xml +++ b/static-analysis/teammates-pmdMain.xml @@ -6,6 +6,7 @@ This is the PMD additional ruleset for TEAMMATES production code. + .*/com/google/appengine/logging/v1/.* .*/test/java/.* .*/e2e/java/.* .*/lnp/java/.* diff --git a/static-analysis/teammates-spotbugs-exclude.xml b/static-analysis/teammates-spotbugs-exclude.xml new file mode 100644 index 00000000000..71b5c69dcc2 --- /dev/null +++ b/static-analysis/teammates-spotbugs-exclude.xml @@ -0,0 +1,7 @@ + + + + + + +