From f5c74d24b85cb7bb4e6449fa556b24f6de187991 Mon Sep 17 00:00:00 2001 From: Jonathan Louie Date: Thu, 5 Oct 2023 04:11:58 -0700 Subject: [PATCH] Create working Gradle project that uses protobuf library for JNI socket client --- java/RedisClient.java | 48 - java/benchmarks/build.gradle | 3 + .../benchmarks/BenchmarkingApp.java | 34 + .../ConnectionRequestOuterClass.java | 4192 +++++++++++++++++ .../javababushka/benchmarks/RedisClient.java | 25 + java/client/RedisClient.java | 24 + .../protobuf/ConnectionRequestOuterClass.java | 4192 +++++++++++++++++ java/src/lib.rs | 2 +- 8 files changed, 8471 insertions(+), 49 deletions(-) delete mode 100644 java/RedisClient.java create mode 100644 java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java create mode 100644 java/benchmarks/src/main/java/javababushka/benchmarks/ConnectionRequestOuterClass.java create mode 100644 java/benchmarks/src/main/java/javababushka/benchmarks/RedisClient.java create mode 100644 java/client/RedisClient.java create mode 100644 java/client/protobuf/ConnectionRequestOuterClass.java diff --git a/java/RedisClient.java b/java/RedisClient.java deleted file mode 100644 index b3ba2c543f..0000000000 --- a/java/RedisClient.java +++ /dev/null @@ -1,48 +0,0 @@ -import java.net.UnixDomainSocketAddress; -import java.net.StandardProtocolFamily; -import java.nio.channels.SocketChannel; -import java.io.IOException; - -class RedisClient { - private static native void startSocketListenerExternal(RedisClient callback); - private static native void startSocketListenerExternal(String callback); - - static { - System.loadLibrary("javababushka"); - } - - private String socketPath; - - public static void main(String[] args) throws InterruptedException { - RedisClient client = new RedisClient(); - RedisClient.startSocketListenerExternal(client); - System.out.println("After starting socket listener"); - - int timeout = 0; - int maxTimeout = 1000; - while (client.socketPath == null && timeout < maxTimeout) { - timeout++; - Thread.sleep(250); - } - - UnixDomainSocketAddress socketAddress = UnixDomainSocketAddress.of(client.socketPath); - try { - SocketChannel channel = SocketChannel.open(StandardProtocolFamily.UNIX); - channel.connect(socketAddress); - //ConnectionRequestOuterClass request = ConnectionRequestOuterClass.newBuilder(); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public void initCallback(String socketPath, String errorMessage) throws Exception { - if (errorMessage != null) { - throw new Exception("Failed to initialize the socket connection: " + errorMessage); - } else if (socketPath == null) { - throw new Exception("Received null as the socketPath"); - } else { - this.socketPath = socketPath; - } - } -} - diff --git a/java/benchmarks/build.gradle b/java/benchmarks/build.gradle index 8d9e500284..618f79e48b 100644 --- a/java/benchmarks/build.gradle +++ b/java/benchmarks/build.gradle @@ -18,6 +18,8 @@ dependencies { implementation 'io.lettuce:lettuce-core:6.2.6.RELEASE' implementation 'commons-cli:commons-cli:1.5.0' implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.13.0' + // https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java + implementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.24.3' } // Apply a specific Java toolchain to ease working on different environments. @@ -30,6 +32,7 @@ java { application { // Define the main class for the application. mainClass = 'javababushka.benchmarks.BenchmarkingApp' + applicationDefaultJvmArgs += "-Djava.library.path=${projectDir}/../target/debug" } tasks.withType(Test) { diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java b/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java new file mode 100644 index 0000000000..ca2a2b6efc --- /dev/null +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/BenchmarkingApp.java @@ -0,0 +1,34 @@ +package javababushka.benchmarks; + +import connection_request.ConnectionRequestOuterClass.ConnectionRequest; +import java.io.IOException; +import java.net.StandardProtocolFamily; +import java.net.UnixDomainSocketAddress; +import java.nio.channels.SocketChannel; +import javababushka.client.RedisClient; + +public class BenchmarkingApp { + + // main application entrypoint + public static void main(String[] args) throws InterruptedException { + RedisClient client = new RedisClient(); + RedisClient.startSocketListenerExternal(client); + System.out.println("After starting socket listener"); + + int timeout = 0; + int maxTimeout = 1000; + while (client.socketPath == null && timeout < maxTimeout) { + timeout++; + Thread.sleep(250); + } + + UnixDomainSocketAddress socketAddress = UnixDomainSocketAddress.of(client.socketPath); + try { + SocketChannel channel = SocketChannel.open(StandardProtocolFamily.UNIX); + channel.connect(socketAddress); + ConnectionRequest request = ConnectionRequest.newBuilder().build(); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/ConnectionRequestOuterClass.java b/java/benchmarks/src/main/java/javababushka/benchmarks/ConnectionRequestOuterClass.java new file mode 100644 index 0000000000..2c7d39acaa --- /dev/null +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/ConnectionRequestOuterClass.java @@ -0,0 +1,4192 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: connection_request.proto + +package connection_request; + +public final class ConnectionRequestOuterClass { + private ConnectionRequestOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + /** Protobuf enum {@code connection_request.ReadFromReplicaStrategy} */ + public enum ReadFromReplicaStrategy implements com.google.protobuf.ProtocolMessageEnum { + /** AlwaysFromPrimary = 0; */ + AlwaysFromPrimary(0), + /** RoundRobin = 1; */ + RoundRobin(1), + /** LowestLatency = 2; */ + LowestLatency(2), + /** AZAffinity = 3; */ + AZAffinity(3), + UNRECOGNIZED(-1), + ; + + /** AlwaysFromPrimary = 0; */ + public static final int AlwaysFromPrimary_VALUE = 0; + + /** RoundRobin = 1; */ + public static final int RoundRobin_VALUE = 1; + + /** LowestLatency = 2; */ + public static final int LowestLatency_VALUE = 2; + + /** AZAffinity = 3; */ + public static final int AZAffinity_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ReadFromReplicaStrategy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ReadFromReplicaStrategy forNumber(int value) { + switch (value) { + case 0: + return AlwaysFromPrimary; + case 1: + return RoundRobin; + case 2: + return LowestLatency; + case 3: + return AZAffinity; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ReadFromReplicaStrategy findValueByNumber(int number) { + return ReadFromReplicaStrategy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final ReadFromReplicaStrategy[] VALUES = values(); + + public static ReadFromReplicaStrategy valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ReadFromReplicaStrategy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:connection_request.ReadFromReplicaStrategy) + } + + /** Protobuf enum {@code connection_request.TlsMode} */ + public enum TlsMode implements com.google.protobuf.ProtocolMessageEnum { + /** NoTls = 0; */ + NoTls(0), + /** SecureTls = 1; */ + SecureTls(1), + /** InsecureTls = 2; */ + InsecureTls(2), + UNRECOGNIZED(-1), + ; + + /** NoTls = 0; */ + public static final int NoTls_VALUE = 0; + + /** SecureTls = 1; */ + public static final int SecureTls_VALUE = 1; + + /** InsecureTls = 2; */ + public static final int InsecureTls_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TlsMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static TlsMode forNumber(int value) { + switch (value) { + case 0: + return NoTls; + case 1: + return SecureTls; + case 2: + return InsecureTls; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TlsMode findValueByNumber(int number) { + return TlsMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass.getDescriptor().getEnumTypes().get(1); + } + + private static final TlsMode[] VALUES = values(); + + public static TlsMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private TlsMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:connection_request.TlsMode) + } + + public interface AddressInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:connection_request.AddressInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string host = 1; + * + * @return The host. + */ + java.lang.String getHost(); + + /** + * string host = 1; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); + + /** + * uint32 port = 2; + * + * @return The port. + */ + int getPort(); + } + + /** Protobuf type {@code connection_request.AddressInfo} */ + public static final class AddressInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:connection_request.AddressInfo) + AddressInfoOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AddressInfo.newBuilder() to construct. + private AddressInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddressInfo() { + host_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddressInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AddressInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AddressInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.AddressInfo.class, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder.class); + } + + public static final int HOST_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + + /** + * string host = 1; + * + * @return The host. + */ + @java.lang.Override + 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; + } + } + + /** + * string host = 1; + * + * @return The bytes for host. + */ + @java.lang.Override + 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 PORT_FIELD_NUMBER = 2; + private int port_ = 0; + + /** + * uint32 port = 2; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, host_); + } + if (port_ != 0) { + output.writeUInt32(2, port_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, host_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(2, port_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof connection_request.ConnectionRequestOuterClass.AddressInfo)) { + return super.equals(obj); + } + connection_request.ConnectionRequestOuterClass.AddressInfo other = + (connection_request.ConnectionRequestOuterClass.AddressInfo) obj; + + if (!getHost().equals(other.getHost())) return false; + if (getPort() != other.getPort()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo 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 connection_request.ConnectionRequestOuterClass.AddressInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo 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 connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + connection_request.ConnectionRequestOuterClass.AddressInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + 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; + } + + /** Protobuf type {@code connection_request.AddressInfo} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:connection_request.AddressInfo) + connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AddressInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AddressInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.AddressInfo.class, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder.class); + } + + // Construct using connection_request.ConnectionRequestOuterClass.AddressInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + host_ = ""; + port_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AddressInfo_descriptor; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfo + getDefaultInstanceForType() { + return connection_request.ConnectionRequestOuterClass.AddressInfo.getDefaultInstance(); + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfo build() { + connection_request.ConnectionRequestOuterClass.AddressInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfo buildPartial() { + connection_request.ConnectionRequestOuterClass.AddressInfo result = + new connection_request.ConnectionRequestOuterClass.AddressInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + connection_request.ConnectionRequestOuterClass.AddressInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.host_ = host_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.port_ = port_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof connection_request.ConnectionRequestOuterClass.AddressInfo) { + return mergeFrom((connection_request.ConnectionRequestOuterClass.AddressInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(connection_request.ConnectionRequestOuterClass.AddressInfo other) { + if (other + == connection_request.ConnectionRequestOuterClass.AddressInfo.getDefaultInstance()) + return this; + if (!other.getHost().isEmpty()) { + host_ = other.host_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + host_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + port_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object host_ = ""; + + /** + * string host = 1; + * + * @return The host. + */ + 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; + } + } + + /** + * string host = 1; + * + * @return The bytes for host. + */ + 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; + } + } + + /** + * string host = 1; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string host = 1; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string host = 1; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int port_; + + /** + * uint32 port = 2; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + /** + * uint32 port = 2; + * + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + port_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * uint32 port = 2; + * + * @return This builder for chaining. + */ + public Builder clearPort() { + bitField0_ = (bitField0_ & ~0x00000002); + port_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:connection_request.AddressInfo) + } + + // @@protoc_insertion_point(class_scope:connection_request.AddressInfo) + private static final connection_request.ConnectionRequestOuterClass.AddressInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new connection_request.ConnectionRequestOuterClass.AddressInfo(); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddressInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AuthenticationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:connection_request.AuthenticationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string password = 1; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * string password = 1; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * string username = 2; + * + * @return The username. + */ + java.lang.String getUsername(); + + /** + * string username = 2; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + } + + /** Protobuf type {@code connection_request.AuthenticationInfo} */ + public static final class AuthenticationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:connection_request.AuthenticationInfo) + AuthenticationInfoOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AuthenticationInfo.newBuilder() to construct. + private AuthenticationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AuthenticationInfo() { + password_ = ""; + username_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AuthenticationInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AuthenticationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AuthenticationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.class, + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder.class); + } + + public static final int PASSWORD_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * string password = 1; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + 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(); + password_ = s; + return s; + } + } + + /** + * string password = 1; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + + /** + * string username = 2; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + 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(); + username_ = s; + return s; + } + } + + /** + * string username = 2; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, password_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, username_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, password_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, username_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof connection_request.ConnectionRequestOuterClass.AuthenticationInfo)) { + return super.equals(obj); + } + connection_request.ConnectionRequestOuterClass.AuthenticationInfo other = + (connection_request.ConnectionRequestOuterClass.AuthenticationInfo) obj; + + if (!getPassword().equals(other.getPassword())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo 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 connection_request.ConnectionRequestOuterClass.AuthenticationInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo + 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 connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + 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; + } + + /** Protobuf type {@code connection_request.AuthenticationInfo} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:connection_request.AuthenticationInfo) + connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AuthenticationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AuthenticationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.class, + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder.class); + } + + // Construct using + // connection_request.ConnectionRequestOuterClass.AuthenticationInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + password_ = ""; + username_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AuthenticationInfo_descriptor; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo + getDefaultInstanceForType() { + return connection_request.ConnectionRequestOuterClass.AuthenticationInfo + .getDefaultInstance(); + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo build() { + connection_request.ConnectionRequestOuterClass.AuthenticationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo buildPartial() { + connection_request.ConnectionRequestOuterClass.AuthenticationInfo result = + new connection_request.ConnectionRequestOuterClass.AuthenticationInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.username_ = username_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof connection_request.ConnectionRequestOuterClass.AuthenticationInfo) { + return mergeFrom( + (connection_request.ConnectionRequestOuterClass.AuthenticationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo other) { + if (other + == connection_request.ConnectionRequestOuterClass.AuthenticationInfo + .getDefaultInstance()) return this; + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object password_ = ""; + + /** + * string password = 1; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string password = 1; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string password = 1; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string password = 1; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string password = 1; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + + /** + * string username = 2; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string username = 2; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string username = 2; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string username = 2; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string username = 2; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:connection_request.AuthenticationInfo) + } + + // @@protoc_insertion_point(class_scope:connection_request.AuthenticationInfo) + private static final connection_request.ConnectionRequestOuterClass.AuthenticationInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new connection_request.ConnectionRequestOuterClass.AuthenticationInfo(); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthenticationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:connection_request.ConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** repeated .connection_request.AddressInfo addresses = 1; */ + java.util.List getAddressesList(); + + /** repeated .connection_request.AddressInfo addresses = 1; */ + connection_request.ConnectionRequestOuterClass.AddressInfo getAddresses(int index); + + /** repeated .connection_request.AddressInfo addresses = 1; */ + int getAddressesCount(); + + /** repeated .connection_request.AddressInfo addresses = 1; */ + java.util.List + getAddressesOrBuilderList(); + + /** repeated .connection_request.AddressInfo addresses = 1; */ + connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder getAddressesOrBuilder( + int index); + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The enum numeric value on the wire for tlsMode. + */ + int getTlsModeValue(); + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The tlsMode. + */ + connection_request.ConnectionRequestOuterClass.TlsMode getTlsMode(); + + /** + * bool cluster_mode_enabled = 3; + * + * @return The clusterModeEnabled. + */ + boolean getClusterModeEnabled(); + + /** + * uint32 response_timeout = 4; + * + * @return The responseTimeout. + */ + int getResponseTimeout(); + + /** + * uint32 client_creation_timeout = 5; + * + * @return The clientCreationTimeout. + */ + int getClientCreationTimeout(); + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The enum numeric value on the wire for readFromReplicaStrategy. + */ + int getReadFromReplicaStrategyValue(); + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The readFromReplicaStrategy. + */ + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy + getReadFromReplicaStrategy(); + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return Whether the connectionRetryStrategy field is set. + */ + boolean hasConnectionRetryStrategy(); + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return The connectionRetryStrategy. + */ + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getConnectionRetryStrategy(); + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder + getConnectionRetryStrategyOrBuilder(); + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return Whether the authenticationInfo field is set. + */ + boolean hasAuthenticationInfo(); + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return The authenticationInfo. + */ + connection_request.ConnectionRequestOuterClass.AuthenticationInfo getAuthenticationInfo(); + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder + getAuthenticationInfoOrBuilder(); + } + + /** Protobuf type {@code connection_request.ConnectionRequest} */ + public static final class ConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:connection_request.ConnectionRequest) + ConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ConnectionRequest.newBuilder() to construct. + private ConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionRequest() { + addresses_ = java.util.Collections.emptyList(); + tlsMode_ = 0; + readFromReplicaStrategy_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.ConnectionRequest.class, + connection_request.ConnectionRequestOuterClass.ConnectionRequest.Builder.class); + } + + public static final int ADDRESSES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List addresses_; + + /** repeated .connection_request.AddressInfo addresses = 1; */ + @java.lang.Override + public java.util.List + getAddressesList() { + return addresses_; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + @java.lang.Override + public java.util.List< + ? extends connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder> + getAddressesOrBuilderList() { + return addresses_; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + @java.lang.Override + public int getAddressesCount() { + return addresses_.size(); + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfo getAddresses(int index) { + return addresses_.get(index); + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder + getAddressesOrBuilder(int index) { + return addresses_.get(index); + } + + public static final int TLS_MODE_FIELD_NUMBER = 2; + private int tlsMode_ = 0; + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The enum numeric value on the wire for tlsMode. + */ + @java.lang.Override + public int getTlsModeValue() { + return tlsMode_; + } + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The tlsMode. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.TlsMode getTlsMode() { + connection_request.ConnectionRequestOuterClass.TlsMode result = + connection_request.ConnectionRequestOuterClass.TlsMode.forNumber(tlsMode_); + return result == null + ? connection_request.ConnectionRequestOuterClass.TlsMode.UNRECOGNIZED + : result; + } + + public static final int CLUSTER_MODE_ENABLED_FIELD_NUMBER = 3; + private boolean clusterModeEnabled_ = false; + + /** + * bool cluster_mode_enabled = 3; + * + * @return The clusterModeEnabled. + */ + @java.lang.Override + public boolean getClusterModeEnabled() { + return clusterModeEnabled_; + } + + public static final int RESPONSE_TIMEOUT_FIELD_NUMBER = 4; + private int responseTimeout_ = 0; + + /** + * uint32 response_timeout = 4; + * + * @return The responseTimeout. + */ + @java.lang.Override + public int getResponseTimeout() { + return responseTimeout_; + } + + public static final int CLIENT_CREATION_TIMEOUT_FIELD_NUMBER = 5; + private int clientCreationTimeout_ = 0; + + /** + * uint32 client_creation_timeout = 5; + * + * @return The clientCreationTimeout. + */ + @java.lang.Override + public int getClientCreationTimeout() { + return clientCreationTimeout_; + } + + public static final int READ_FROM_REPLICA_STRATEGY_FIELD_NUMBER = 6; + private int readFromReplicaStrategy_ = 0; + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The enum numeric value on the wire for readFromReplicaStrategy. + */ + @java.lang.Override + public int getReadFromReplicaStrategyValue() { + return readFromReplicaStrategy_; + } + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The readFromReplicaStrategy. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy + getReadFromReplicaStrategy() { + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy result = + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy.forNumber( + readFromReplicaStrategy_); + return result == null + ? connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy.UNRECOGNIZED + : result; + } + + public static final int CONNECTION_RETRY_STRATEGY_FIELD_NUMBER = 7; + private connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + connectionRetryStrategy_; + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return Whether the connectionRetryStrategy field is set. + */ + @java.lang.Override + public boolean hasConnectionRetryStrategy() { + return connectionRetryStrategy_ != null; + } + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return The connectionRetryStrategy. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getConnectionRetryStrategy() { + return connectionRetryStrategy_ == null + ? connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance() + : connectionRetryStrategy_; + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder + getConnectionRetryStrategyOrBuilder() { + return connectionRetryStrategy_ == null + ? connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance() + : connectionRetryStrategy_; + } + + public static final int AUTHENTICATION_INFO_FIELD_NUMBER = 8; + private connection_request.ConnectionRequestOuterClass.AuthenticationInfo authenticationInfo_; + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return Whether the authenticationInfo field is set. + */ + @java.lang.Override + public boolean hasAuthenticationInfo() { + return authenticationInfo_ != null; + } + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return The authenticationInfo. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo + getAuthenticationInfo() { + return authenticationInfo_ == null + ? connection_request.ConnectionRequestOuterClass.AuthenticationInfo.getDefaultInstance() + : authenticationInfo_; + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder + getAuthenticationInfoOrBuilder() { + return authenticationInfo_ == null + ? connection_request.ConnectionRequestOuterClass.AuthenticationInfo.getDefaultInstance() + : authenticationInfo_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < addresses_.size(); i++) { + output.writeMessage(1, addresses_.get(i)); + } + if (tlsMode_ != connection_request.ConnectionRequestOuterClass.TlsMode.NoTls.getNumber()) { + output.writeEnum(2, tlsMode_); + } + if (clusterModeEnabled_ != false) { + output.writeBool(3, clusterModeEnabled_); + } + if (responseTimeout_ != 0) { + output.writeUInt32(4, responseTimeout_); + } + if (clientCreationTimeout_ != 0) { + output.writeUInt32(5, clientCreationTimeout_); + } + if (readFromReplicaStrategy_ + != connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy + .AlwaysFromPrimary.getNumber()) { + output.writeEnum(6, readFromReplicaStrategy_); + } + if (connectionRetryStrategy_ != null) { + output.writeMessage(7, getConnectionRetryStrategy()); + } + if (authenticationInfo_ != null) { + output.writeMessage(8, getAuthenticationInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < addresses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, addresses_.get(i)); + } + if (tlsMode_ != connection_request.ConnectionRequestOuterClass.TlsMode.NoTls.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, tlsMode_); + } + if (clusterModeEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, clusterModeEnabled_); + } + if (responseTimeout_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(4, responseTimeout_); + } + if (clientCreationTimeout_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(5, clientCreationTimeout_); + } + if (readFromReplicaStrategy_ + != connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy + .AlwaysFromPrimary.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, readFromReplicaStrategy_); + } + if (connectionRetryStrategy_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, getConnectionRetryStrategy()); + } + if (authenticationInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(8, getAuthenticationInfo()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof connection_request.ConnectionRequestOuterClass.ConnectionRequest)) { + return super.equals(obj); + } + connection_request.ConnectionRequestOuterClass.ConnectionRequest other = + (connection_request.ConnectionRequestOuterClass.ConnectionRequest) obj; + + if (!getAddressesList().equals(other.getAddressesList())) return false; + if (tlsMode_ != other.tlsMode_) return false; + if (getClusterModeEnabled() != other.getClusterModeEnabled()) return false; + if (getResponseTimeout() != other.getResponseTimeout()) return false; + if (getClientCreationTimeout() != other.getClientCreationTimeout()) return false; + if (readFromReplicaStrategy_ != other.readFromReplicaStrategy_) return false; + if (hasConnectionRetryStrategy() != other.hasConnectionRetryStrategy()) return false; + if (hasConnectionRetryStrategy()) { + if (!getConnectionRetryStrategy().equals(other.getConnectionRetryStrategy())) return false; + } + if (hasAuthenticationInfo() != other.hasAuthenticationInfo()) return false; + if (hasAuthenticationInfo()) { + if (!getAuthenticationInfo().equals(other.getAuthenticationInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAddressesCount() > 0) { + hash = (37 * hash) + ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getAddressesList().hashCode(); + } + hash = (37 * hash) + TLS_MODE_FIELD_NUMBER; + hash = (53 * hash) + tlsMode_; + hash = (37 * hash) + CLUSTER_MODE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClusterModeEnabled()); + hash = (37 * hash) + RESPONSE_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getResponseTimeout(); + hash = (37 * hash) + CLIENT_CREATION_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getClientCreationTimeout(); + hash = (37 * hash) + READ_FROM_REPLICA_STRATEGY_FIELD_NUMBER; + hash = (53 * hash) + readFromReplicaStrategy_; + if (hasConnectionRetryStrategy()) { + hash = (37 * hash) + CONNECTION_RETRY_STRATEGY_FIELD_NUMBER; + hash = (53 * hash) + getConnectionRetryStrategy().hashCode(); + } + if (hasAuthenticationInfo()) { + hash = (37 * hash) + AUTHENTICATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getAuthenticationInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest 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 connection_request.ConnectionRequestOuterClass.ConnectionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest + 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 connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + connection_request.ConnectionRequestOuterClass.ConnectionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + 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; + } + + /** Protobuf type {@code connection_request.ConnectionRequest} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:connection_request.ConnectionRequest) + connection_request.ConnectionRequestOuterClass.ConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.ConnectionRequest.class, + connection_request.ConnectionRequestOuterClass.ConnectionRequest.Builder.class); + } + + // Construct using + // connection_request.ConnectionRequestOuterClass.ConnectionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (addressesBuilder_ == null) { + addresses_ = java.util.Collections.emptyList(); + } else { + addresses_ = null; + addressesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + tlsMode_ = 0; + clusterModeEnabled_ = false; + responseTimeout_ = 0; + clientCreationTimeout_ = 0; + readFromReplicaStrategy_ = 0; + connectionRetryStrategy_ = null; + if (connectionRetryStrategyBuilder_ != null) { + connectionRetryStrategyBuilder_.dispose(); + connectionRetryStrategyBuilder_ = null; + } + authenticationInfo_ = null; + if (authenticationInfoBuilder_ != null) { + authenticationInfoBuilder_.dispose(); + authenticationInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRequest_descriptor; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRequest + getDefaultInstanceForType() { + return connection_request.ConnectionRequestOuterClass.ConnectionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRequest build() { + connection_request.ConnectionRequestOuterClass.ConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRequest buildPartial() { + connection_request.ConnectionRequestOuterClass.ConnectionRequest result = + new connection_request.ConnectionRequestOuterClass.ConnectionRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + connection_request.ConnectionRequestOuterClass.ConnectionRequest result) { + if (addressesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + addresses_ = java.util.Collections.unmodifiableList(addresses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.addresses_ = addresses_; + } else { + result.addresses_ = addressesBuilder_.build(); + } + } + + private void buildPartial0( + connection_request.ConnectionRequestOuterClass.ConnectionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tlsMode_ = tlsMode_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.clusterModeEnabled_ = clusterModeEnabled_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.responseTimeout_ = responseTimeout_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.clientCreationTimeout_ = clientCreationTimeout_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.readFromReplicaStrategy_ = readFromReplicaStrategy_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.connectionRetryStrategy_ = + connectionRetryStrategyBuilder_ == null + ? connectionRetryStrategy_ + : connectionRetryStrategyBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.authenticationInfo_ = + authenticationInfoBuilder_ == null + ? authenticationInfo_ + : authenticationInfoBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof connection_request.ConnectionRequestOuterClass.ConnectionRequest) { + return mergeFrom( + (connection_request.ConnectionRequestOuterClass.ConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + connection_request.ConnectionRequestOuterClass.ConnectionRequest other) { + if (other + == connection_request.ConnectionRequestOuterClass.ConnectionRequest + .getDefaultInstance()) return this; + if (addressesBuilder_ == null) { + if (!other.addresses_.isEmpty()) { + if (addresses_.isEmpty()) { + addresses_ = other.addresses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAddressesIsMutable(); + addresses_.addAll(other.addresses_); + } + onChanged(); + } + } else { + if (!other.addresses_.isEmpty()) { + if (addressesBuilder_.isEmpty()) { + addressesBuilder_.dispose(); + addressesBuilder_ = null; + addresses_ = other.addresses_; + bitField0_ = (bitField0_ & ~0x00000001); + addressesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAddressesFieldBuilder() + : null; + } else { + addressesBuilder_.addAllMessages(other.addresses_); + } + } + } + if (other.tlsMode_ != 0) { + setTlsModeValue(other.getTlsModeValue()); + } + if (other.getClusterModeEnabled() != false) { + setClusterModeEnabled(other.getClusterModeEnabled()); + } + if (other.getResponseTimeout() != 0) { + setResponseTimeout(other.getResponseTimeout()); + } + if (other.getClientCreationTimeout() != 0) { + setClientCreationTimeout(other.getClientCreationTimeout()); + } + if (other.readFromReplicaStrategy_ != 0) { + setReadFromReplicaStrategyValue(other.getReadFromReplicaStrategyValue()); + } + if (other.hasConnectionRetryStrategy()) { + mergeConnectionRetryStrategy(other.getConnectionRetryStrategy()); + } + if (other.hasAuthenticationInfo()) { + mergeAuthenticationInfo(other.getAuthenticationInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + connection_request.ConnectionRequestOuterClass.AddressInfo m = + input.readMessage( + connection_request.ConnectionRequestOuterClass.AddressInfo.parser(), + extensionRegistry); + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + addresses_.add(m); + } else { + addressesBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: + { + tlsMode_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + clusterModeEnabled_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + responseTimeout_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + clientCreationTimeout_ = input.readUInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + readFromReplicaStrategy_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + input.readMessage( + getConnectionRetryStrategyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage( + getAuthenticationInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + addresses_ = java.util.Collections.emptyList(); + + private void ensureAddressesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + addresses_ = + new java.util.ArrayList( + addresses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AddressInfo, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder, + connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder> + addressesBuilder_; + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public java.util.List + getAddressesList() { + if (addressesBuilder_ == null) { + return java.util.Collections.unmodifiableList(addresses_); + } else { + return addressesBuilder_.getMessageList(); + } + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public int getAddressesCount() { + if (addressesBuilder_ == null) { + return addresses_.size(); + } else { + return addressesBuilder_.getCount(); + } + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public connection_request.ConnectionRequestOuterClass.AddressInfo getAddresses(int index) { + if (addressesBuilder_ == null) { + return addresses_.get(index); + } else { + return addressesBuilder_.getMessage(index); + } + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder setAddresses( + int index, connection_request.ConnectionRequestOuterClass.AddressInfo value) { + if (addressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAddressesIsMutable(); + addresses_.set(index, value); + onChanged(); + } else { + addressesBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder setAddresses( + int index, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder builderForValue) { + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + addresses_.set(index, builderForValue.build()); + onChanged(); + } else { + addressesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder addAddresses( + connection_request.ConnectionRequestOuterClass.AddressInfo value) { + if (addressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAddressesIsMutable(); + addresses_.add(value); + onChanged(); + } else { + addressesBuilder_.addMessage(value); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder addAddresses( + int index, connection_request.ConnectionRequestOuterClass.AddressInfo value) { + if (addressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAddressesIsMutable(); + addresses_.add(index, value); + onChanged(); + } else { + addressesBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder addAddresses( + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder builderForValue) { + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + addresses_.add(builderForValue.build()); + onChanged(); + } else { + addressesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder addAddresses( + int index, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder builderForValue) { + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + addresses_.add(index, builderForValue.build()); + onChanged(); + } else { + addressesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder addAllAddresses( + java.lang.Iterable + values) { + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, addresses_); + onChanged(); + } else { + addressesBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder clearAddresses() { + if (addressesBuilder_ == null) { + addresses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + addressesBuilder_.clear(); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder removeAddresses(int index) { + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + addresses_.remove(index); + onChanged(); + } else { + addressesBuilder_.remove(index); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public connection_request.ConnectionRequestOuterClass.AddressInfo.Builder getAddressesBuilder( + int index) { + return getAddressesFieldBuilder().getBuilder(index); + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder + getAddressesOrBuilder(int index) { + if (addressesBuilder_ == null) { + return addresses_.get(index); + } else { + return addressesBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public java.util.List< + ? extends connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder> + getAddressesOrBuilderList() { + if (addressesBuilder_ != null) { + return addressesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(addresses_); + } + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public connection_request.ConnectionRequestOuterClass.AddressInfo.Builder + addAddressesBuilder() { + return getAddressesFieldBuilder() + .addBuilder( + connection_request.ConnectionRequestOuterClass.AddressInfo.getDefaultInstance()); + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public connection_request.ConnectionRequestOuterClass.AddressInfo.Builder addAddressesBuilder( + int index) { + return getAddressesFieldBuilder() + .addBuilder( + index, + connection_request.ConnectionRequestOuterClass.AddressInfo.getDefaultInstance()); + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public java.util.List + getAddressesBuilderList() { + return getAddressesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AddressInfo, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder, + connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder> + getAddressesFieldBuilder() { + if (addressesBuilder_ == null) { + addressesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AddressInfo, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder, + connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder>( + addresses_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + addresses_ = null; + } + return addressesBuilder_; + } + + private int tlsMode_ = 0; + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The enum numeric value on the wire for tlsMode. + */ + @java.lang.Override + public int getTlsModeValue() { + return tlsMode_; + } + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @param value The enum numeric value on the wire for tlsMode to set. + * @return This builder for chaining. + */ + public Builder setTlsModeValue(int value) { + tlsMode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The tlsMode. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.TlsMode getTlsMode() { + connection_request.ConnectionRequestOuterClass.TlsMode result = + connection_request.ConnectionRequestOuterClass.TlsMode.forNumber(tlsMode_); + return result == null + ? connection_request.ConnectionRequestOuterClass.TlsMode.UNRECOGNIZED + : result; + } + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @param value The tlsMode to set. + * @return This builder for chaining. + */ + public Builder setTlsMode(connection_request.ConnectionRequestOuterClass.TlsMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + tlsMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return This builder for chaining. + */ + public Builder clearTlsMode() { + bitField0_ = (bitField0_ & ~0x00000002); + tlsMode_ = 0; + onChanged(); + return this; + } + + private boolean clusterModeEnabled_; + + /** + * bool cluster_mode_enabled = 3; + * + * @return The clusterModeEnabled. + */ + @java.lang.Override + public boolean getClusterModeEnabled() { + return clusterModeEnabled_; + } + + /** + * bool cluster_mode_enabled = 3; + * + * @param value The clusterModeEnabled to set. + * @return This builder for chaining. + */ + public Builder setClusterModeEnabled(boolean value) { + + clusterModeEnabled_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * bool cluster_mode_enabled = 3; + * + * @return This builder for chaining. + */ + public Builder clearClusterModeEnabled() { + bitField0_ = (bitField0_ & ~0x00000004); + clusterModeEnabled_ = false; + onChanged(); + return this; + } + + private int responseTimeout_; + + /** + * uint32 response_timeout = 4; + * + * @return The responseTimeout. + */ + @java.lang.Override + public int getResponseTimeout() { + return responseTimeout_; + } + + /** + * uint32 response_timeout = 4; + * + * @param value The responseTimeout to set. + * @return This builder for chaining. + */ + public Builder setResponseTimeout(int value) { + + responseTimeout_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * uint32 response_timeout = 4; + * + * @return This builder for chaining. + */ + public Builder clearResponseTimeout() { + bitField0_ = (bitField0_ & ~0x00000008); + responseTimeout_ = 0; + onChanged(); + return this; + } + + private int clientCreationTimeout_; + + /** + * uint32 client_creation_timeout = 5; + * + * @return The clientCreationTimeout. + */ + @java.lang.Override + public int getClientCreationTimeout() { + return clientCreationTimeout_; + } + + /** + * uint32 client_creation_timeout = 5; + * + * @param value The clientCreationTimeout to set. + * @return This builder for chaining. + */ + public Builder setClientCreationTimeout(int value) { + + clientCreationTimeout_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * uint32 client_creation_timeout = 5; + * + * @return This builder for chaining. + */ + public Builder clearClientCreationTimeout() { + bitField0_ = (bitField0_ & ~0x00000010); + clientCreationTimeout_ = 0; + onChanged(); + return this; + } + + private int readFromReplicaStrategy_ = 0; + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The enum numeric value on the wire for readFromReplicaStrategy. + */ + @java.lang.Override + public int getReadFromReplicaStrategyValue() { + return readFromReplicaStrategy_; + } + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @param value The enum numeric value on the wire for readFromReplicaStrategy to set. + * @return This builder for chaining. + */ + public Builder setReadFromReplicaStrategyValue(int value) { + readFromReplicaStrategy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The readFromReplicaStrategy. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy + getReadFromReplicaStrategy() { + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy result = + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy.forNumber( + readFromReplicaStrategy_); + return result == null + ? connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy.UNRECOGNIZED + : result; + } + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @param value The readFromReplicaStrategy to set. + * @return This builder for chaining. + */ + public Builder setReadFromReplicaStrategy( + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + readFromReplicaStrategy_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return This builder for chaining. + */ + public Builder clearReadFromReplicaStrategy() { + bitField0_ = (bitField0_ & ~0x00000020); + readFromReplicaStrategy_ = 0; + onChanged(); + return this; + } + + private connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + connectionRetryStrategy_; + private com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder> + connectionRetryStrategyBuilder_; + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return Whether the connectionRetryStrategy field is set. + */ + public boolean hasConnectionRetryStrategy() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return The connectionRetryStrategy. + */ + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getConnectionRetryStrategy() { + if (connectionRetryStrategyBuilder_ == null) { + return connectionRetryStrategy_ == null + ? connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance() + : connectionRetryStrategy_; + } else { + return connectionRetryStrategyBuilder_.getMessage(); + } + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public Builder setConnectionRetryStrategy( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy value) { + if (connectionRetryStrategyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionRetryStrategy_ = value; + } else { + connectionRetryStrategyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public Builder setConnectionRetryStrategy( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder + builderForValue) { + if (connectionRetryStrategyBuilder_ == null) { + connectionRetryStrategy_ = builderForValue.build(); + } else { + connectionRetryStrategyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public Builder mergeConnectionRetryStrategy( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy value) { + if (connectionRetryStrategyBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && connectionRetryStrategy_ != null + && connectionRetryStrategy_ + != connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance()) { + getConnectionRetryStrategyBuilder().mergeFrom(value); + } else { + connectionRetryStrategy_ = value; + } + } else { + connectionRetryStrategyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public Builder clearConnectionRetryStrategy() { + bitField0_ = (bitField0_ & ~0x00000040); + connectionRetryStrategy_ = null; + if (connectionRetryStrategyBuilder_ != null) { + connectionRetryStrategyBuilder_.dispose(); + connectionRetryStrategyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder + getConnectionRetryStrategyBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getConnectionRetryStrategyFieldBuilder().getBuilder(); + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder + getConnectionRetryStrategyOrBuilder() { + if (connectionRetryStrategyBuilder_ != null) { + return connectionRetryStrategyBuilder_.getMessageOrBuilder(); + } else { + return connectionRetryStrategy_ == null + ? connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance() + : connectionRetryStrategy_; + } + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + private com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder> + getConnectionRetryStrategyFieldBuilder() { + if (connectionRetryStrategyBuilder_ == null) { + connectionRetryStrategyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder>( + getConnectionRetryStrategy(), getParentForChildren(), isClean()); + connectionRetryStrategy_ = null; + } + return connectionRetryStrategyBuilder_; + } + + private connection_request.ConnectionRequestOuterClass.AuthenticationInfo authenticationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AuthenticationInfo, + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder, + connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder> + authenticationInfoBuilder_; + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return Whether the authenticationInfo field is set. + */ + public boolean hasAuthenticationInfo() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return The authenticationInfo. + */ + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo + getAuthenticationInfo() { + if (authenticationInfoBuilder_ == null) { + return authenticationInfo_ == null + ? connection_request.ConnectionRequestOuterClass.AuthenticationInfo + .getDefaultInstance() + : authenticationInfo_; + } else { + return authenticationInfoBuilder_.getMessage(); + } + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public Builder setAuthenticationInfo( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo value) { + if (authenticationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authenticationInfo_ = value; + } else { + authenticationInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public Builder setAuthenticationInfo( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder + builderForValue) { + if (authenticationInfoBuilder_ == null) { + authenticationInfo_ = builderForValue.build(); + } else { + authenticationInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public Builder mergeAuthenticationInfo( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo value) { + if (authenticationInfoBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && authenticationInfo_ != null + && authenticationInfo_ + != connection_request.ConnectionRequestOuterClass.AuthenticationInfo + .getDefaultInstance()) { + getAuthenticationInfoBuilder().mergeFrom(value); + } else { + authenticationInfo_ = value; + } + } else { + authenticationInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public Builder clearAuthenticationInfo() { + bitField0_ = (bitField0_ & ~0x00000080); + authenticationInfo_ = null; + if (authenticationInfoBuilder_ != null) { + authenticationInfoBuilder_.dispose(); + authenticationInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder + getAuthenticationInfoBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getAuthenticationInfoFieldBuilder().getBuilder(); + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder + getAuthenticationInfoOrBuilder() { + if (authenticationInfoBuilder_ != null) { + return authenticationInfoBuilder_.getMessageOrBuilder(); + } else { + return authenticationInfo_ == null + ? connection_request.ConnectionRequestOuterClass.AuthenticationInfo + .getDefaultInstance() + : authenticationInfo_; + } + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + private com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AuthenticationInfo, + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder, + connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder> + getAuthenticationInfoFieldBuilder() { + if (authenticationInfoBuilder_ == null) { + authenticationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AuthenticationInfo, + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder, + connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder>( + getAuthenticationInfo(), getParentForChildren(), isClean()); + authenticationInfo_ = null; + } + return authenticationInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:connection_request.ConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:connection_request.ConnectionRequest) + private static final connection_request.ConnectionRequestOuterClass.ConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new connection_request.ConnectionRequestOuterClass.ConnectionRequest(); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConnectionRetryStrategyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:connection_request.ConnectionRetryStrategy) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 number_of_retries = 1; + * + * @return The numberOfRetries. + */ + int getNumberOfRetries(); + + /** + * uint32 factor = 2; + * + * @return The factor. + */ + int getFactor(); + + /** + * uint32 exponent_base = 3; + * + * @return The exponentBase. + */ + int getExponentBase(); + } + + /** Protobuf type {@code connection_request.ConnectionRetryStrategy} */ + public static final class ConnectionRetryStrategy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:connection_request.ConnectionRetryStrategy) + ConnectionRetryStrategyOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ConnectionRetryStrategy.newBuilder() to construct. + private ConnectionRetryStrategy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionRetryStrategy() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionRetryStrategy(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRetryStrategy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRetryStrategy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.class, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder.class); + } + + public static final int NUMBER_OF_RETRIES_FIELD_NUMBER = 1; + private int numberOfRetries_ = 0; + + /** + * uint32 number_of_retries = 1; + * + * @return The numberOfRetries. + */ + @java.lang.Override + public int getNumberOfRetries() { + return numberOfRetries_; + } + + public static final int FACTOR_FIELD_NUMBER = 2; + private int factor_ = 0; + + /** + * uint32 factor = 2; + * + * @return The factor. + */ + @java.lang.Override + public int getFactor() { + return factor_; + } + + public static final int EXPONENT_BASE_FIELD_NUMBER = 3; + private int exponentBase_ = 0; + + /** + * uint32 exponent_base = 3; + * + * @return The exponentBase. + */ + @java.lang.Override + public int getExponentBase() { + return exponentBase_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (numberOfRetries_ != 0) { + output.writeUInt32(1, numberOfRetries_); + } + if (factor_ != 0) { + output.writeUInt32(2, factor_); + } + if (exponentBase_ != 0) { + output.writeUInt32(3, exponentBase_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numberOfRetries_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(1, numberOfRetries_); + } + if (factor_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(2, factor_); + } + if (exponentBase_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(3, exponentBase_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy)) { + return super.equals(obj); + } + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy other = + (connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy) obj; + + if (getNumberOfRetries() != other.getNumberOfRetries()) return false; + if (getFactor() != other.getFactor()) return false; + if (getExponentBase() != other.getExponentBase()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NUMBER_OF_RETRIES_FIELD_NUMBER; + hash = (53 * hash) + getNumberOfRetries(); + hash = (37 * hash) + FACTOR_FIELD_NUMBER; + hash = (53 * hash) + getFactor(); + hash = (37 * hash) + EXPONENT_BASE_FIELD_NUMBER; + hash = (53 * hash) + getExponentBase(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy 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 connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + 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 connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + 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; + } + + /** Protobuf type {@code connection_request.ConnectionRetryStrategy} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:connection_request.ConnectionRetryStrategy) + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRetryStrategy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRetryStrategy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.class, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder + .class); + } + + // Construct using + // connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + numberOfRetries_ = 0; + factor_ = 0; + exponentBase_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRetryStrategy_descriptor; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getDefaultInstanceForType() { + return connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance(); + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy build() { + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy buildPartial() { + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy result = + new connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.numberOfRetries_ = numberOfRetries_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.factor_ = factor_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.exponentBase_ = exponentBase_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy) { + return mergeFrom( + (connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy other) { + if (other + == connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance()) return this; + if (other.getNumberOfRetries() != 0) { + setNumberOfRetries(other.getNumberOfRetries()); + } + if (other.getFactor() != 0) { + setFactor(other.getFactor()); + } + if (other.getExponentBase() != 0) { + setExponentBase(other.getExponentBase()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + numberOfRetries_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + factor_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + exponentBase_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int numberOfRetries_; + + /** + * uint32 number_of_retries = 1; + * + * @return The numberOfRetries. + */ + @java.lang.Override + public int getNumberOfRetries() { + return numberOfRetries_; + } + + /** + * uint32 number_of_retries = 1; + * + * @param value The numberOfRetries to set. + * @return This builder for chaining. + */ + public Builder setNumberOfRetries(int value) { + + numberOfRetries_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * uint32 number_of_retries = 1; + * + * @return This builder for chaining. + */ + public Builder clearNumberOfRetries() { + bitField0_ = (bitField0_ & ~0x00000001); + numberOfRetries_ = 0; + onChanged(); + return this; + } + + private int factor_; + + /** + * uint32 factor = 2; + * + * @return The factor. + */ + @java.lang.Override + public int getFactor() { + return factor_; + } + + /** + * uint32 factor = 2; + * + * @param value The factor to set. + * @return This builder for chaining. + */ + public Builder setFactor(int value) { + + factor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * uint32 factor = 2; + * + * @return This builder for chaining. + */ + public Builder clearFactor() { + bitField0_ = (bitField0_ & ~0x00000002); + factor_ = 0; + onChanged(); + return this; + } + + private int exponentBase_; + + /** + * uint32 exponent_base = 3; + * + * @return The exponentBase. + */ + @java.lang.Override + public int getExponentBase() { + return exponentBase_; + } + + /** + * uint32 exponent_base = 3; + * + * @param value The exponentBase to set. + * @return This builder for chaining. + */ + public Builder setExponentBase(int value) { + + exponentBase_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * uint32 exponent_base = 3; + * + * @return This builder for chaining. + */ + public Builder clearExponentBase() { + bitField0_ = (bitField0_ & ~0x00000004); + exponentBase_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:connection_request.ConnectionRetryStrategy) + } + + // @@protoc_insertion_point(class_scope:connection_request.ConnectionRetryStrategy) + private static final connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy(); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionRetryStrategy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_connection_request_AddressInfo_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_connection_request_AddressInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_connection_request_AuthenticationInfo_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_connection_request_AuthenticationInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_connection_request_ConnectionRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_connection_request_ConnectionRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_connection_request_ConnectionRetryStrategy_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_connection_request_ConnectionRetryStrategy_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\030connection_request.proto\022\022connection_r" + + "equest\")\n\013AddressInfo\022\014\n\004host\030\001 \001(\t\022\014\n\004p" + + "ort\030\002 \001(\r\"8\n\022AuthenticationInfo\022\020\n\010passw" + + "ord\030\001 \001(\t\022\020\n\010username\030\002 \001(\t\"\265\003\n\021Connecti" + + "onRequest\0222\n\taddresses\030\001 \003(\0132\037.connectio" + + "n_request.AddressInfo\022-\n\010tls_mode\030\002 \001(\0162" + + "\033.connection_request.TlsMode\022\034\n\024cluster_" + + "mode_enabled\030\003 \001(\010\022\030\n\020response_timeout\030\004" + + " \001(\r\022\037\n\027client_creation_timeout\030\005 \001(\r\022O\n" + + "\032read_from_replica_strategy\030\006 \001(\0162+.conn" + + "ection_request.ReadFromReplicaStrategy\022N" + + "\n\031connection_retry_strategy\030\007 \001(\0132+.conn" + + "ection_request.ConnectionRetryStrategy\022C" + + "\n\023authentication_info\030\010 \001(\0132&.connection" + + "_request.AuthenticationInfo\"[\n\027Connectio" + + "nRetryStrategy\022\031\n\021number_of_retries\030\001 \001(" + + "\r\022\016\n\006factor\030\002 \001(\r\022\025\n\rexponent_base\030\003 \001(\r" + + "*c\n\027ReadFromReplicaStrategy\022\025\n\021AlwaysFro" + + "mPrimary\020\000\022\016\n\nRoundRobin\020\001\022\021\n\rLowestLate" + + "ncy\020\002\022\016\n\nAZAffinity\020\003*4\n\007TlsMode\022\t\n\005NoTl" + + "s\020\000\022\r\n\tSecureTls\020\001\022\017\n\013InsecureTls\020\002b\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_connection_request_AddressInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_connection_request_AddressInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_connection_request_AddressInfo_descriptor, + new java.lang.String[] { + "Host", "Port", + }); + internal_static_connection_request_AuthenticationInfo_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_connection_request_AuthenticationInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_connection_request_AuthenticationInfo_descriptor, + new java.lang.String[] { + "Password", "Username", + }); + internal_static_connection_request_ConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_connection_request_ConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_connection_request_ConnectionRequest_descriptor, + new java.lang.String[] { + "Addresses", + "TlsMode", + "ClusterModeEnabled", + "ResponseTimeout", + "ClientCreationTimeout", + "ReadFromReplicaStrategy", + "ConnectionRetryStrategy", + "AuthenticationInfo", + }); + internal_static_connection_request_ConnectionRetryStrategy_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_connection_request_ConnectionRetryStrategy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_connection_request_ConnectionRetryStrategy_descriptor, + new java.lang.String[] { + "NumberOfRetries", "Factor", "ExponentBase", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java/benchmarks/src/main/java/javababushka/benchmarks/RedisClient.java b/java/benchmarks/src/main/java/javababushka/benchmarks/RedisClient.java new file mode 100644 index 0000000000..bb2e164c6d --- /dev/null +++ b/java/benchmarks/src/main/java/javababushka/benchmarks/RedisClient.java @@ -0,0 +1,25 @@ +package javababushka.client; + +public class RedisClient { + public static native void startSocketListenerExternal(RedisClient callback); + + static { + System.loadLibrary("javababushka"); + } + + public String socketPath; + + public void startSocketListener(RedisClient client) { + client.startSocketListenerExternal(client); + } + + public void initCallback(String socketPath, String errorMessage) throws Exception { + if (errorMessage != null) { + throw new Exception("Failed to initialize the socket connection: " + errorMessage); + } else if (socketPath == null) { + throw new Exception("Received null as the socketPath"); + } else { + this.socketPath = socketPath; + } + } +} diff --git a/java/client/RedisClient.java b/java/client/RedisClient.java new file mode 100644 index 0000000000..b2eb3fba79 --- /dev/null +++ b/java/client/RedisClient.java @@ -0,0 +1,24 @@ +public class RedisClient { + private static native void startSocketListenerExternal(RedisClient callback); + + static { + System.loadLibrary("javababushka"); + } + + public String socketPath; + + public static void main(String[] args) throws Exception { + RedisClient c = new RedisClient(); + startSocketListenerExternal(c); + } + + public void initCallback(String socketPath, String errorMessage) throws Exception { + if (errorMessage != null) { + throw new Exception("Failed to initialize the socket connection: " + errorMessage); + } else if (socketPath == null) { + throw new Exception("Received null as the socketPath"); + } else { + this.socketPath = socketPath; + } + } +} diff --git a/java/client/protobuf/ConnectionRequestOuterClass.java b/java/client/protobuf/ConnectionRequestOuterClass.java new file mode 100644 index 0000000000..2c7d39acaa --- /dev/null +++ b/java/client/protobuf/ConnectionRequestOuterClass.java @@ -0,0 +1,4192 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: connection_request.proto + +package connection_request; + +public final class ConnectionRequestOuterClass { + private ConnectionRequestOuterClass() {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistryLite registry) {} + + public static void registerAllExtensions(com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions((com.google.protobuf.ExtensionRegistryLite) registry); + } + + /** Protobuf enum {@code connection_request.ReadFromReplicaStrategy} */ + public enum ReadFromReplicaStrategy implements com.google.protobuf.ProtocolMessageEnum { + /** AlwaysFromPrimary = 0; */ + AlwaysFromPrimary(0), + /** RoundRobin = 1; */ + RoundRobin(1), + /** LowestLatency = 2; */ + LowestLatency(2), + /** AZAffinity = 3; */ + AZAffinity(3), + UNRECOGNIZED(-1), + ; + + /** AlwaysFromPrimary = 0; */ + public static final int AlwaysFromPrimary_VALUE = 0; + + /** RoundRobin = 1; */ + public static final int RoundRobin_VALUE = 1; + + /** LowestLatency = 2; */ + public static final int LowestLatency_VALUE = 2; + + /** AZAffinity = 3; */ + public static final int AZAffinity_VALUE = 3; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static ReadFromReplicaStrategy valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static ReadFromReplicaStrategy forNumber(int value) { + switch (value) { + case 0: + return AlwaysFromPrimary; + case 1: + return RoundRobin; + case 2: + return LowestLatency; + case 3: + return AZAffinity; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap + internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public ReadFromReplicaStrategy findValueByNumber(int number) { + return ReadFromReplicaStrategy.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass.getDescriptor().getEnumTypes().get(0); + } + + private static final ReadFromReplicaStrategy[] VALUES = values(); + + public static ReadFromReplicaStrategy valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private ReadFromReplicaStrategy(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:connection_request.ReadFromReplicaStrategy) + } + + /** Protobuf enum {@code connection_request.TlsMode} */ + public enum TlsMode implements com.google.protobuf.ProtocolMessageEnum { + /** NoTls = 0; */ + NoTls(0), + /** SecureTls = 1; */ + SecureTls(1), + /** InsecureTls = 2; */ + InsecureTls(2), + UNRECOGNIZED(-1), + ; + + /** NoTls = 0; */ + public static final int NoTls_VALUE = 0; + + /** SecureTls = 1; */ + public static final int SecureTls_VALUE = 1; + + /** InsecureTls = 2; */ + public static final int InsecureTls_VALUE = 2; + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static TlsMode valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static TlsMode forNumber(int value) { + switch (value) { + case 0: + return NoTls; + case 1: + return SecureTls; + case 2: + return InsecureTls; + default: + return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap internalGetValueMap() { + return internalValueMap; + } + + private static final com.google.protobuf.Internal.EnumLiteMap internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TlsMode findValueByNumber(int number) { + return TlsMode.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + + public final com.google.protobuf.Descriptors.EnumDescriptor getDescriptorForType() { + return getDescriptor(); + } + + public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass.getDescriptor().getEnumTypes().get(1); + } + + private static final TlsMode[] VALUES = values(); + + public static TlsMode valueOf(com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException("EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private TlsMode(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:connection_request.TlsMode) + } + + public interface AddressInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:connection_request.AddressInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string host = 1; + * + * @return The host. + */ + java.lang.String getHost(); + + /** + * string host = 1; + * + * @return The bytes for host. + */ + com.google.protobuf.ByteString getHostBytes(); + + /** + * uint32 port = 2; + * + * @return The port. + */ + int getPort(); + } + + /** Protobuf type {@code connection_request.AddressInfo} */ + public static final class AddressInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:connection_request.AddressInfo) + AddressInfoOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AddressInfo.newBuilder() to construct. + private AddressInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AddressInfo() { + host_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AddressInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AddressInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AddressInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.AddressInfo.class, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder.class); + } + + public static final int HOST_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object host_ = ""; + + /** + * string host = 1; + * + * @return The host. + */ + @java.lang.Override + 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; + } + } + + /** + * string host = 1; + * + * @return The bytes for host. + */ + @java.lang.Override + 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 PORT_FIELD_NUMBER = 2; + private int port_ = 0; + + /** + * uint32 port = 2; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(host_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, host_); + } + if (port_ != 0) { + output.writeUInt32(2, port_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(host_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, host_); + } + if (port_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(2, port_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof connection_request.ConnectionRequestOuterClass.AddressInfo)) { + return super.equals(obj); + } + connection_request.ConnectionRequestOuterClass.AddressInfo other = + (connection_request.ConnectionRequestOuterClass.AddressInfo) obj; + + if (!getHost().equals(other.getHost())) return false; + if (getPort() != other.getPort()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + HOST_FIELD_NUMBER; + hash = (53 * hash) + getHost().hashCode(); + hash = (37 * hash) + PORT_FIELD_NUMBER; + hash = (53 * hash) + getPort(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo 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 connection_request.ConnectionRequestOuterClass.AddressInfo parseDelimitedFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo 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 connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + connection_request.ConnectionRequestOuterClass.AddressInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + 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; + } + + /** Protobuf type {@code connection_request.AddressInfo} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:connection_request.AddressInfo) + connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AddressInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AddressInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.AddressInfo.class, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder.class); + } + + // Construct using connection_request.ConnectionRequestOuterClass.AddressInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + host_ = ""; + port_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AddressInfo_descriptor; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfo + getDefaultInstanceForType() { + return connection_request.ConnectionRequestOuterClass.AddressInfo.getDefaultInstance(); + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfo build() { + connection_request.ConnectionRequestOuterClass.AddressInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfo buildPartial() { + connection_request.ConnectionRequestOuterClass.AddressInfo result = + new connection_request.ConnectionRequestOuterClass.AddressInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + connection_request.ConnectionRequestOuterClass.AddressInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.host_ = host_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.port_ = port_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof connection_request.ConnectionRequestOuterClass.AddressInfo) { + return mergeFrom((connection_request.ConnectionRequestOuterClass.AddressInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(connection_request.ConnectionRequestOuterClass.AddressInfo other) { + if (other + == connection_request.ConnectionRequestOuterClass.AddressInfo.getDefaultInstance()) + return this; + if (!other.getHost().isEmpty()) { + host_ = other.host_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (other.getPort() != 0) { + setPort(other.getPort()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + host_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 16: + { + port_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object host_ = ""; + + /** + * string host = 1; + * + * @return The host. + */ + 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; + } + } + + /** + * string host = 1; + * + * @return The bytes for host. + */ + 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; + } + } + + /** + * string host = 1; + * + * @param value The host to set. + * @return This builder for chaining. + */ + public Builder setHost(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string host = 1; + * + * @return This builder for chaining. + */ + public Builder clearHost() { + host_ = getDefaultInstance().getHost(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string host = 1; + * + * @param value The bytes for host to set. + * @return This builder for chaining. + */ + public Builder setHostBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + host_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private int port_; + + /** + * uint32 port = 2; + * + * @return The port. + */ + @java.lang.Override + public int getPort() { + return port_; + } + + /** + * uint32 port = 2; + * + * @param value The port to set. + * @return This builder for chaining. + */ + public Builder setPort(int value) { + + port_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * uint32 port = 2; + * + * @return This builder for chaining. + */ + public Builder clearPort() { + bitField0_ = (bitField0_ & ~0x00000002); + port_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:connection_request.AddressInfo) + } + + // @@protoc_insertion_point(class_scope:connection_request.AddressInfo) + private static final connection_request.ConnectionRequestOuterClass.AddressInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new connection_request.ConnectionRequestOuterClass.AddressInfo(); + } + + public static connection_request.ConnectionRequestOuterClass.AddressInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AddressInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface AuthenticationInfoOrBuilder + extends + // @@protoc_insertion_point(interface_extends:connection_request.AuthenticationInfo) + com.google.protobuf.MessageOrBuilder { + + /** + * string password = 1; + * + * @return The password. + */ + java.lang.String getPassword(); + + /** + * string password = 1; + * + * @return The bytes for password. + */ + com.google.protobuf.ByteString getPasswordBytes(); + + /** + * string username = 2; + * + * @return The username. + */ + java.lang.String getUsername(); + + /** + * string username = 2; + * + * @return The bytes for username. + */ + com.google.protobuf.ByteString getUsernameBytes(); + } + + /** Protobuf type {@code connection_request.AuthenticationInfo} */ + public static final class AuthenticationInfo extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:connection_request.AuthenticationInfo) + AuthenticationInfoOrBuilder { + private static final long serialVersionUID = 0L; + + // Use AuthenticationInfo.newBuilder() to construct. + private AuthenticationInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private AuthenticationInfo() { + password_ = ""; + username_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new AuthenticationInfo(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AuthenticationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AuthenticationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.class, + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder.class); + } + + public static final int PASSWORD_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private volatile java.lang.Object password_ = ""; + + /** + * string password = 1; + * + * @return The password. + */ + @java.lang.Override + public java.lang.String getPassword() { + java.lang.Object ref = password_; + 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(); + password_ = s; + return s; + } + } + + /** + * string password = 1; + * + * @return The bytes for password. + */ + @java.lang.Override + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int USERNAME_FIELD_NUMBER = 2; + + @SuppressWarnings("serial") + private volatile java.lang.Object username_ = ""; + + /** + * string username = 2; + * + * @return The username. + */ + @java.lang.Override + public java.lang.String getUsername() { + java.lang.Object ref = username_; + 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(); + username_ = s; + return s; + } + } + + /** + * string username = 2; + * + * @return The bytes for username. + */ + @java.lang.Override + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, password_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(username_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, username_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(password_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, password_); + } + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(username_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, username_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof connection_request.ConnectionRequestOuterClass.AuthenticationInfo)) { + return super.equals(obj); + } + connection_request.ConnectionRequestOuterClass.AuthenticationInfo other = + (connection_request.ConnectionRequestOuterClass.AuthenticationInfo) obj; + + if (!getPassword().equals(other.getPassword())) return false; + if (!getUsername().equals(other.getUsername())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + PASSWORD_FIELD_NUMBER; + hash = (53 * hash) + getPassword().hashCode(); + hash = (37 * hash) + USERNAME_FIELD_NUMBER; + hash = (53 * hash) + getUsername().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo 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 connection_request.ConnectionRequestOuterClass.AuthenticationInfo + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo + 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 connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + 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; + } + + /** Protobuf type {@code connection_request.AuthenticationInfo} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:connection_request.AuthenticationInfo) + connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AuthenticationInfo_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AuthenticationInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.class, + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder.class); + } + + // Construct using + // connection_request.ConnectionRequestOuterClass.AuthenticationInfo.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + password_ = ""; + username_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_AuthenticationInfo_descriptor; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo + getDefaultInstanceForType() { + return connection_request.ConnectionRequestOuterClass.AuthenticationInfo + .getDefaultInstance(); + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo build() { + connection_request.ConnectionRequestOuterClass.AuthenticationInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo buildPartial() { + connection_request.ConnectionRequestOuterClass.AuthenticationInfo result = + new connection_request.ConnectionRequestOuterClass.AuthenticationInfo(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.password_ = password_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.username_ = username_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof connection_request.ConnectionRequestOuterClass.AuthenticationInfo) { + return mergeFrom( + (connection_request.ConnectionRequestOuterClass.AuthenticationInfo) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo other) { + if (other + == connection_request.ConnectionRequestOuterClass.AuthenticationInfo + .getDefaultInstance()) return this; + if (!other.getPassword().isEmpty()) { + password_ = other.password_; + bitField0_ |= 0x00000001; + onChanged(); + } + if (!other.getUsername().isEmpty()) { + username_ = other.username_; + bitField0_ |= 0x00000002; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + password_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + case 18: + { + username_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000002; + break; + } // case 18 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.lang.Object password_ = ""; + + /** + * string password = 1; + * + * @return The password. + */ + public java.lang.String getPassword() { + java.lang.Object ref = password_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + password_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string password = 1; + * + * @return The bytes for password. + */ + public com.google.protobuf.ByteString getPasswordBytes() { + java.lang.Object ref = password_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + password_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string password = 1; + * + * @param value The password to set. + * @return This builder for chaining. + */ + public Builder setPassword(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + password_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * string password = 1; + * + * @return This builder for chaining. + */ + public Builder clearPassword() { + password_ = getDefaultInstance().getPassword(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + + /** + * string password = 1; + * + * @param value The bytes for password to set. + * @return This builder for chaining. + */ + public Builder setPasswordBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + password_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + private java.lang.Object username_ = ""; + + /** + * string username = 2; + * + * @return The username. + */ + public java.lang.String getUsername() { + java.lang.Object ref = username_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + username_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + + /** + * string username = 2; + * + * @return The bytes for username. + */ + public com.google.protobuf.ByteString getUsernameBytes() { + java.lang.Object ref = username_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref); + username_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + /** + * string username = 2; + * + * @param value The username to set. + * @return This builder for chaining. + */ + public Builder setUsername(java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * string username = 2; + * + * @return This builder for chaining. + */ + public Builder clearUsername() { + username_ = getDefaultInstance().getUsername(); + bitField0_ = (bitField0_ & ~0x00000002); + onChanged(); + return this; + } + + /** + * string username = 2; + * + * @param value The bytes for username to set. + * @return This builder for chaining. + */ + public Builder setUsernameBytes(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + username_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:connection_request.AuthenticationInfo) + } + + // @@protoc_insertion_point(class_scope:connection_request.AuthenticationInfo) + private static final connection_request.ConnectionRequestOuterClass.AuthenticationInfo + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new connection_request.ConnectionRequestOuterClass.AuthenticationInfo(); + } + + public static connection_request.ConnectionRequestOuterClass.AuthenticationInfo + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public AuthenticationInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConnectionRequestOrBuilder + extends + // @@protoc_insertion_point(interface_extends:connection_request.ConnectionRequest) + com.google.protobuf.MessageOrBuilder { + + /** repeated .connection_request.AddressInfo addresses = 1; */ + java.util.List getAddressesList(); + + /** repeated .connection_request.AddressInfo addresses = 1; */ + connection_request.ConnectionRequestOuterClass.AddressInfo getAddresses(int index); + + /** repeated .connection_request.AddressInfo addresses = 1; */ + int getAddressesCount(); + + /** repeated .connection_request.AddressInfo addresses = 1; */ + java.util.List + getAddressesOrBuilderList(); + + /** repeated .connection_request.AddressInfo addresses = 1; */ + connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder getAddressesOrBuilder( + int index); + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The enum numeric value on the wire for tlsMode. + */ + int getTlsModeValue(); + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The tlsMode. + */ + connection_request.ConnectionRequestOuterClass.TlsMode getTlsMode(); + + /** + * bool cluster_mode_enabled = 3; + * + * @return The clusterModeEnabled. + */ + boolean getClusterModeEnabled(); + + /** + * uint32 response_timeout = 4; + * + * @return The responseTimeout. + */ + int getResponseTimeout(); + + /** + * uint32 client_creation_timeout = 5; + * + * @return The clientCreationTimeout. + */ + int getClientCreationTimeout(); + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The enum numeric value on the wire for readFromReplicaStrategy. + */ + int getReadFromReplicaStrategyValue(); + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The readFromReplicaStrategy. + */ + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy + getReadFromReplicaStrategy(); + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return Whether the connectionRetryStrategy field is set. + */ + boolean hasConnectionRetryStrategy(); + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return The connectionRetryStrategy. + */ + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getConnectionRetryStrategy(); + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder + getConnectionRetryStrategyOrBuilder(); + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return Whether the authenticationInfo field is set. + */ + boolean hasAuthenticationInfo(); + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return The authenticationInfo. + */ + connection_request.ConnectionRequestOuterClass.AuthenticationInfo getAuthenticationInfo(); + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder + getAuthenticationInfoOrBuilder(); + } + + /** Protobuf type {@code connection_request.ConnectionRequest} */ + public static final class ConnectionRequest extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:connection_request.ConnectionRequest) + ConnectionRequestOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ConnectionRequest.newBuilder() to construct. + private ConnectionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionRequest() { + addresses_ = java.util.Collections.emptyList(); + tlsMode_ = 0; + readFromReplicaStrategy_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionRequest(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.ConnectionRequest.class, + connection_request.ConnectionRequestOuterClass.ConnectionRequest.Builder.class); + } + + public static final int ADDRESSES_FIELD_NUMBER = 1; + + @SuppressWarnings("serial") + private java.util.List addresses_; + + /** repeated .connection_request.AddressInfo addresses = 1; */ + @java.lang.Override + public java.util.List + getAddressesList() { + return addresses_; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + @java.lang.Override + public java.util.List< + ? extends connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder> + getAddressesOrBuilderList() { + return addresses_; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + @java.lang.Override + public int getAddressesCount() { + return addresses_.size(); + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfo getAddresses(int index) { + return addresses_.get(index); + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder + getAddressesOrBuilder(int index) { + return addresses_.get(index); + } + + public static final int TLS_MODE_FIELD_NUMBER = 2; + private int tlsMode_ = 0; + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The enum numeric value on the wire for tlsMode. + */ + @java.lang.Override + public int getTlsModeValue() { + return tlsMode_; + } + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The tlsMode. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.TlsMode getTlsMode() { + connection_request.ConnectionRequestOuterClass.TlsMode result = + connection_request.ConnectionRequestOuterClass.TlsMode.forNumber(tlsMode_); + return result == null + ? connection_request.ConnectionRequestOuterClass.TlsMode.UNRECOGNIZED + : result; + } + + public static final int CLUSTER_MODE_ENABLED_FIELD_NUMBER = 3; + private boolean clusterModeEnabled_ = false; + + /** + * bool cluster_mode_enabled = 3; + * + * @return The clusterModeEnabled. + */ + @java.lang.Override + public boolean getClusterModeEnabled() { + return clusterModeEnabled_; + } + + public static final int RESPONSE_TIMEOUT_FIELD_NUMBER = 4; + private int responseTimeout_ = 0; + + /** + * uint32 response_timeout = 4; + * + * @return The responseTimeout. + */ + @java.lang.Override + public int getResponseTimeout() { + return responseTimeout_; + } + + public static final int CLIENT_CREATION_TIMEOUT_FIELD_NUMBER = 5; + private int clientCreationTimeout_ = 0; + + /** + * uint32 client_creation_timeout = 5; + * + * @return The clientCreationTimeout. + */ + @java.lang.Override + public int getClientCreationTimeout() { + return clientCreationTimeout_; + } + + public static final int READ_FROM_REPLICA_STRATEGY_FIELD_NUMBER = 6; + private int readFromReplicaStrategy_ = 0; + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The enum numeric value on the wire for readFromReplicaStrategy. + */ + @java.lang.Override + public int getReadFromReplicaStrategyValue() { + return readFromReplicaStrategy_; + } + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The readFromReplicaStrategy. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy + getReadFromReplicaStrategy() { + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy result = + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy.forNumber( + readFromReplicaStrategy_); + return result == null + ? connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy.UNRECOGNIZED + : result; + } + + public static final int CONNECTION_RETRY_STRATEGY_FIELD_NUMBER = 7; + private connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + connectionRetryStrategy_; + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return Whether the connectionRetryStrategy field is set. + */ + @java.lang.Override + public boolean hasConnectionRetryStrategy() { + return connectionRetryStrategy_ != null; + } + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return The connectionRetryStrategy. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getConnectionRetryStrategy() { + return connectionRetryStrategy_ == null + ? connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance() + : connectionRetryStrategy_; + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder + getConnectionRetryStrategyOrBuilder() { + return connectionRetryStrategy_ == null + ? connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance() + : connectionRetryStrategy_; + } + + public static final int AUTHENTICATION_INFO_FIELD_NUMBER = 8; + private connection_request.ConnectionRequestOuterClass.AuthenticationInfo authenticationInfo_; + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return Whether the authenticationInfo field is set. + */ + @java.lang.Override + public boolean hasAuthenticationInfo() { + return authenticationInfo_ != null; + } + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return The authenticationInfo. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo + getAuthenticationInfo() { + return authenticationInfo_ == null + ? connection_request.ConnectionRequestOuterClass.AuthenticationInfo.getDefaultInstance() + : authenticationInfo_; + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder + getAuthenticationInfoOrBuilder() { + return authenticationInfo_ == null + ? connection_request.ConnectionRequestOuterClass.AuthenticationInfo.getDefaultInstance() + : authenticationInfo_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + for (int i = 0; i < addresses_.size(); i++) { + output.writeMessage(1, addresses_.get(i)); + } + if (tlsMode_ != connection_request.ConnectionRequestOuterClass.TlsMode.NoTls.getNumber()) { + output.writeEnum(2, tlsMode_); + } + if (clusterModeEnabled_ != false) { + output.writeBool(3, clusterModeEnabled_); + } + if (responseTimeout_ != 0) { + output.writeUInt32(4, responseTimeout_); + } + if (clientCreationTimeout_ != 0) { + output.writeUInt32(5, clientCreationTimeout_); + } + if (readFromReplicaStrategy_ + != connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy + .AlwaysFromPrimary.getNumber()) { + output.writeEnum(6, readFromReplicaStrategy_); + } + if (connectionRetryStrategy_ != null) { + output.writeMessage(7, getConnectionRetryStrategy()); + } + if (authenticationInfo_ != null) { + output.writeMessage(8, getAuthenticationInfo()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < addresses_.size(); i++) { + size += com.google.protobuf.CodedOutputStream.computeMessageSize(1, addresses_.get(i)); + } + if (tlsMode_ != connection_request.ConnectionRequestOuterClass.TlsMode.NoTls.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(2, tlsMode_); + } + if (clusterModeEnabled_ != false) { + size += com.google.protobuf.CodedOutputStream.computeBoolSize(3, clusterModeEnabled_); + } + if (responseTimeout_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(4, responseTimeout_); + } + if (clientCreationTimeout_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(5, clientCreationTimeout_); + } + if (readFromReplicaStrategy_ + != connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy + .AlwaysFromPrimary.getNumber()) { + size += com.google.protobuf.CodedOutputStream.computeEnumSize(6, readFromReplicaStrategy_); + } + if (connectionRetryStrategy_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize( + 7, getConnectionRetryStrategy()); + } + if (authenticationInfo_ != null) { + size += + com.google.protobuf.CodedOutputStream.computeMessageSize(8, getAuthenticationInfo()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof connection_request.ConnectionRequestOuterClass.ConnectionRequest)) { + return super.equals(obj); + } + connection_request.ConnectionRequestOuterClass.ConnectionRequest other = + (connection_request.ConnectionRequestOuterClass.ConnectionRequest) obj; + + if (!getAddressesList().equals(other.getAddressesList())) return false; + if (tlsMode_ != other.tlsMode_) return false; + if (getClusterModeEnabled() != other.getClusterModeEnabled()) return false; + if (getResponseTimeout() != other.getResponseTimeout()) return false; + if (getClientCreationTimeout() != other.getClientCreationTimeout()) return false; + if (readFromReplicaStrategy_ != other.readFromReplicaStrategy_) return false; + if (hasConnectionRetryStrategy() != other.hasConnectionRetryStrategy()) return false; + if (hasConnectionRetryStrategy()) { + if (!getConnectionRetryStrategy().equals(other.getConnectionRetryStrategy())) return false; + } + if (hasAuthenticationInfo() != other.hasAuthenticationInfo()) return false; + if (hasAuthenticationInfo()) { + if (!getAuthenticationInfo().equals(other.getAuthenticationInfo())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getAddressesCount() > 0) { + hash = (37 * hash) + ADDRESSES_FIELD_NUMBER; + hash = (53 * hash) + getAddressesList().hashCode(); + } + hash = (37 * hash) + TLS_MODE_FIELD_NUMBER; + hash = (53 * hash) + tlsMode_; + hash = (37 * hash) + CLUSTER_MODE_ENABLED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(getClusterModeEnabled()); + hash = (37 * hash) + RESPONSE_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getResponseTimeout(); + hash = (37 * hash) + CLIENT_CREATION_TIMEOUT_FIELD_NUMBER; + hash = (53 * hash) + getClientCreationTimeout(); + hash = (37 * hash) + READ_FROM_REPLICA_STRATEGY_FIELD_NUMBER; + hash = (53 * hash) + readFromReplicaStrategy_; + if (hasConnectionRetryStrategy()) { + hash = (37 * hash) + CONNECTION_RETRY_STRATEGY_FIELD_NUMBER; + hash = (53 * hash) + getConnectionRetryStrategy().hashCode(); + } + if (hasAuthenticationInfo()) { + hash = (37 * hash) + AUTHENTICATION_INFO_FIELD_NUMBER; + hash = (53 * hash) + getAuthenticationInfo().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest 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 connection_request.ConnectionRequestOuterClass.ConnectionRequest + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest + 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 connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + connection_request.ConnectionRequestOuterClass.ConnectionRequest prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + 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; + } + + /** Protobuf type {@code connection_request.ConnectionRequest} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:connection_request.ConnectionRequest) + connection_request.ConnectionRequestOuterClass.ConnectionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.ConnectionRequest.class, + connection_request.ConnectionRequestOuterClass.ConnectionRequest.Builder.class); + } + + // Construct using + // connection_request.ConnectionRequestOuterClass.ConnectionRequest.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + if (addressesBuilder_ == null) { + addresses_ = java.util.Collections.emptyList(); + } else { + addresses_ = null; + addressesBuilder_.clear(); + } + bitField0_ = (bitField0_ & ~0x00000001); + tlsMode_ = 0; + clusterModeEnabled_ = false; + responseTimeout_ = 0; + clientCreationTimeout_ = 0; + readFromReplicaStrategy_ = 0; + connectionRetryStrategy_ = null; + if (connectionRetryStrategyBuilder_ != null) { + connectionRetryStrategyBuilder_.dispose(); + connectionRetryStrategyBuilder_ = null; + } + authenticationInfo_ = null; + if (authenticationInfoBuilder_ != null) { + authenticationInfoBuilder_.dispose(); + authenticationInfoBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRequest_descriptor; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRequest + getDefaultInstanceForType() { + return connection_request.ConnectionRequestOuterClass.ConnectionRequest + .getDefaultInstance(); + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRequest build() { + connection_request.ConnectionRequestOuterClass.ConnectionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRequest buildPartial() { + connection_request.ConnectionRequestOuterClass.ConnectionRequest result = + new connection_request.ConnectionRequestOuterClass.ConnectionRequest(this); + buildPartialRepeatedFields(result); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartialRepeatedFields( + connection_request.ConnectionRequestOuterClass.ConnectionRequest result) { + if (addressesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + addresses_ = java.util.Collections.unmodifiableList(addresses_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.addresses_ = addresses_; + } else { + result.addresses_ = addressesBuilder_.build(); + } + } + + private void buildPartial0( + connection_request.ConnectionRequestOuterClass.ConnectionRequest result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000002) != 0)) { + result.tlsMode_ = tlsMode_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.clusterModeEnabled_ = clusterModeEnabled_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.responseTimeout_ = responseTimeout_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.clientCreationTimeout_ = clientCreationTimeout_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.readFromReplicaStrategy_ = readFromReplicaStrategy_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.connectionRetryStrategy_ = + connectionRetryStrategyBuilder_ == null + ? connectionRetryStrategy_ + : connectionRetryStrategyBuilder_.build(); + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.authenticationInfo_ = + authenticationInfoBuilder_ == null + ? authenticationInfo_ + : authenticationInfoBuilder_.build(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof connection_request.ConnectionRequestOuterClass.ConnectionRequest) { + return mergeFrom( + (connection_request.ConnectionRequestOuterClass.ConnectionRequest) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + connection_request.ConnectionRequestOuterClass.ConnectionRequest other) { + if (other + == connection_request.ConnectionRequestOuterClass.ConnectionRequest + .getDefaultInstance()) return this; + if (addressesBuilder_ == null) { + if (!other.addresses_.isEmpty()) { + if (addresses_.isEmpty()) { + addresses_ = other.addresses_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureAddressesIsMutable(); + addresses_.addAll(other.addresses_); + } + onChanged(); + } + } else { + if (!other.addresses_.isEmpty()) { + if (addressesBuilder_.isEmpty()) { + addressesBuilder_.dispose(); + addressesBuilder_ = null; + addresses_ = other.addresses_; + bitField0_ = (bitField0_ & ~0x00000001); + addressesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders + ? getAddressesFieldBuilder() + : null; + } else { + addressesBuilder_.addAllMessages(other.addresses_); + } + } + } + if (other.tlsMode_ != 0) { + setTlsModeValue(other.getTlsModeValue()); + } + if (other.getClusterModeEnabled() != false) { + setClusterModeEnabled(other.getClusterModeEnabled()); + } + if (other.getResponseTimeout() != 0) { + setResponseTimeout(other.getResponseTimeout()); + } + if (other.getClientCreationTimeout() != 0) { + setClientCreationTimeout(other.getClientCreationTimeout()); + } + if (other.readFromReplicaStrategy_ != 0) { + setReadFromReplicaStrategyValue(other.getReadFromReplicaStrategyValue()); + } + if (other.hasConnectionRetryStrategy()) { + mergeConnectionRetryStrategy(other.getConnectionRetryStrategy()); + } + if (other.hasAuthenticationInfo()) { + mergeAuthenticationInfo(other.getAuthenticationInfo()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: + { + connection_request.ConnectionRequestOuterClass.AddressInfo m = + input.readMessage( + connection_request.ConnectionRequestOuterClass.AddressInfo.parser(), + extensionRegistry); + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + addresses_.add(m); + } else { + addressesBuilder_.addMessage(m); + } + break; + } // case 10 + case 16: + { + tlsMode_ = input.readEnum(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + clusterModeEnabled_ = input.readBool(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: + { + responseTimeout_ = input.readUInt32(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: + { + clientCreationTimeout_ = input.readUInt32(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: + { + readFromReplicaStrategy_ = input.readEnum(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 58: + { + input.readMessage( + getConnectionRetryStrategyFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000040; + break; + } // case 58 + case 66: + { + input.readMessage( + getAuthenticationInfoFieldBuilder().getBuilder(), extensionRegistry); + bitField0_ |= 0x00000080; + break; + } // case 66 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private java.util.List + addresses_ = java.util.Collections.emptyList(); + + private void ensureAddressesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + addresses_ = + new java.util.ArrayList( + addresses_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AddressInfo, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder, + connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder> + addressesBuilder_; + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public java.util.List + getAddressesList() { + if (addressesBuilder_ == null) { + return java.util.Collections.unmodifiableList(addresses_); + } else { + return addressesBuilder_.getMessageList(); + } + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public int getAddressesCount() { + if (addressesBuilder_ == null) { + return addresses_.size(); + } else { + return addressesBuilder_.getCount(); + } + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public connection_request.ConnectionRequestOuterClass.AddressInfo getAddresses(int index) { + if (addressesBuilder_ == null) { + return addresses_.get(index); + } else { + return addressesBuilder_.getMessage(index); + } + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder setAddresses( + int index, connection_request.ConnectionRequestOuterClass.AddressInfo value) { + if (addressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAddressesIsMutable(); + addresses_.set(index, value); + onChanged(); + } else { + addressesBuilder_.setMessage(index, value); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder setAddresses( + int index, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder builderForValue) { + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + addresses_.set(index, builderForValue.build()); + onChanged(); + } else { + addressesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder addAddresses( + connection_request.ConnectionRequestOuterClass.AddressInfo value) { + if (addressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAddressesIsMutable(); + addresses_.add(value); + onChanged(); + } else { + addressesBuilder_.addMessage(value); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder addAddresses( + int index, connection_request.ConnectionRequestOuterClass.AddressInfo value) { + if (addressesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureAddressesIsMutable(); + addresses_.add(index, value); + onChanged(); + } else { + addressesBuilder_.addMessage(index, value); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder addAddresses( + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder builderForValue) { + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + addresses_.add(builderForValue.build()); + onChanged(); + } else { + addressesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder addAddresses( + int index, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder builderForValue) { + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + addresses_.add(index, builderForValue.build()); + onChanged(); + } else { + addressesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder addAllAddresses( + java.lang.Iterable + values) { + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll(values, addresses_); + onChanged(); + } else { + addressesBuilder_.addAllMessages(values); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder clearAddresses() { + if (addressesBuilder_ == null) { + addresses_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + addressesBuilder_.clear(); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public Builder removeAddresses(int index) { + if (addressesBuilder_ == null) { + ensureAddressesIsMutable(); + addresses_.remove(index); + onChanged(); + } else { + addressesBuilder_.remove(index); + } + return this; + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public connection_request.ConnectionRequestOuterClass.AddressInfo.Builder getAddressesBuilder( + int index) { + return getAddressesFieldBuilder().getBuilder(index); + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder + getAddressesOrBuilder(int index) { + if (addressesBuilder_ == null) { + return addresses_.get(index); + } else { + return addressesBuilder_.getMessageOrBuilder(index); + } + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public java.util.List< + ? extends connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder> + getAddressesOrBuilderList() { + if (addressesBuilder_ != null) { + return addressesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(addresses_); + } + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public connection_request.ConnectionRequestOuterClass.AddressInfo.Builder + addAddressesBuilder() { + return getAddressesFieldBuilder() + .addBuilder( + connection_request.ConnectionRequestOuterClass.AddressInfo.getDefaultInstance()); + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public connection_request.ConnectionRequestOuterClass.AddressInfo.Builder addAddressesBuilder( + int index) { + return getAddressesFieldBuilder() + .addBuilder( + index, + connection_request.ConnectionRequestOuterClass.AddressInfo.getDefaultInstance()); + } + + /** repeated .connection_request.AddressInfo addresses = 1; */ + public java.util.List + getAddressesBuilderList() { + return getAddressesFieldBuilder().getBuilderList(); + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AddressInfo, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder, + connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder> + getAddressesFieldBuilder() { + if (addressesBuilder_ == null) { + addressesBuilder_ = + new com.google.protobuf.RepeatedFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AddressInfo, + connection_request.ConnectionRequestOuterClass.AddressInfo.Builder, + connection_request.ConnectionRequestOuterClass.AddressInfoOrBuilder>( + addresses_, ((bitField0_ & 0x00000001) != 0), getParentForChildren(), isClean()); + addresses_ = null; + } + return addressesBuilder_; + } + + private int tlsMode_ = 0; + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The enum numeric value on the wire for tlsMode. + */ + @java.lang.Override + public int getTlsModeValue() { + return tlsMode_; + } + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @param value The enum numeric value on the wire for tlsMode to set. + * @return This builder for chaining. + */ + public Builder setTlsModeValue(int value) { + tlsMode_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return The tlsMode. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.TlsMode getTlsMode() { + connection_request.ConnectionRequestOuterClass.TlsMode result = + connection_request.ConnectionRequestOuterClass.TlsMode.forNumber(tlsMode_); + return result == null + ? connection_request.ConnectionRequestOuterClass.TlsMode.UNRECOGNIZED + : result; + } + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @param value The tlsMode to set. + * @return This builder for chaining. + */ + public Builder setTlsMode(connection_request.ConnectionRequestOuterClass.TlsMode value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000002; + tlsMode_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .connection_request.TlsMode tls_mode = 2; + * + * @return This builder for chaining. + */ + public Builder clearTlsMode() { + bitField0_ = (bitField0_ & ~0x00000002); + tlsMode_ = 0; + onChanged(); + return this; + } + + private boolean clusterModeEnabled_; + + /** + * bool cluster_mode_enabled = 3; + * + * @return The clusterModeEnabled. + */ + @java.lang.Override + public boolean getClusterModeEnabled() { + return clusterModeEnabled_; + } + + /** + * bool cluster_mode_enabled = 3; + * + * @param value The clusterModeEnabled to set. + * @return This builder for chaining. + */ + public Builder setClusterModeEnabled(boolean value) { + + clusterModeEnabled_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * bool cluster_mode_enabled = 3; + * + * @return This builder for chaining. + */ + public Builder clearClusterModeEnabled() { + bitField0_ = (bitField0_ & ~0x00000004); + clusterModeEnabled_ = false; + onChanged(); + return this; + } + + private int responseTimeout_; + + /** + * uint32 response_timeout = 4; + * + * @return The responseTimeout. + */ + @java.lang.Override + public int getResponseTimeout() { + return responseTimeout_; + } + + /** + * uint32 response_timeout = 4; + * + * @param value The responseTimeout to set. + * @return This builder for chaining. + */ + public Builder setResponseTimeout(int value) { + + responseTimeout_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + + /** + * uint32 response_timeout = 4; + * + * @return This builder for chaining. + */ + public Builder clearResponseTimeout() { + bitField0_ = (bitField0_ & ~0x00000008); + responseTimeout_ = 0; + onChanged(); + return this; + } + + private int clientCreationTimeout_; + + /** + * uint32 client_creation_timeout = 5; + * + * @return The clientCreationTimeout. + */ + @java.lang.Override + public int getClientCreationTimeout() { + return clientCreationTimeout_; + } + + /** + * uint32 client_creation_timeout = 5; + * + * @param value The clientCreationTimeout to set. + * @return This builder for chaining. + */ + public Builder setClientCreationTimeout(int value) { + + clientCreationTimeout_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + + /** + * uint32 client_creation_timeout = 5; + * + * @return This builder for chaining. + */ + public Builder clearClientCreationTimeout() { + bitField0_ = (bitField0_ & ~0x00000010); + clientCreationTimeout_ = 0; + onChanged(); + return this; + } + + private int readFromReplicaStrategy_ = 0; + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The enum numeric value on the wire for readFromReplicaStrategy. + */ + @java.lang.Override + public int getReadFromReplicaStrategyValue() { + return readFromReplicaStrategy_; + } + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @param value The enum numeric value on the wire for readFromReplicaStrategy to set. + * @return This builder for chaining. + */ + public Builder setReadFromReplicaStrategyValue(int value) { + readFromReplicaStrategy_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return The readFromReplicaStrategy. + */ + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy + getReadFromReplicaStrategy() { + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy result = + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy.forNumber( + readFromReplicaStrategy_); + return result == null + ? connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy.UNRECOGNIZED + : result; + } + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @param value The readFromReplicaStrategy to set. + * @return This builder for chaining. + */ + public Builder setReadFromReplicaStrategy( + connection_request.ConnectionRequestOuterClass.ReadFromReplicaStrategy value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000020; + readFromReplicaStrategy_ = value.getNumber(); + onChanged(); + return this; + } + + /** + * .connection_request.ReadFromReplicaStrategy read_from_replica_strategy = 6; + * + * @return This builder for chaining. + */ + public Builder clearReadFromReplicaStrategy() { + bitField0_ = (bitField0_ & ~0x00000020); + readFromReplicaStrategy_ = 0; + onChanged(); + return this; + } + + private connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + connectionRetryStrategy_; + private com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder> + connectionRetryStrategyBuilder_; + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return Whether the connectionRetryStrategy field is set. + */ + public boolean hasConnectionRetryStrategy() { + return ((bitField0_ & 0x00000040) != 0); + } + + /** + * .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; + * + * @return The connectionRetryStrategy. + */ + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getConnectionRetryStrategy() { + if (connectionRetryStrategyBuilder_ == null) { + return connectionRetryStrategy_ == null + ? connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance() + : connectionRetryStrategy_; + } else { + return connectionRetryStrategyBuilder_.getMessage(); + } + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public Builder setConnectionRetryStrategy( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy value) { + if (connectionRetryStrategyBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + connectionRetryStrategy_ = value; + } else { + connectionRetryStrategyBuilder_.setMessage(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public Builder setConnectionRetryStrategy( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder + builderForValue) { + if (connectionRetryStrategyBuilder_ == null) { + connectionRetryStrategy_ = builderForValue.build(); + } else { + connectionRetryStrategyBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public Builder mergeConnectionRetryStrategy( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy value) { + if (connectionRetryStrategyBuilder_ == null) { + if (((bitField0_ & 0x00000040) != 0) + && connectionRetryStrategy_ != null + && connectionRetryStrategy_ + != connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance()) { + getConnectionRetryStrategyBuilder().mergeFrom(value); + } else { + connectionRetryStrategy_ = value; + } + } else { + connectionRetryStrategyBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public Builder clearConnectionRetryStrategy() { + bitField0_ = (bitField0_ & ~0x00000040); + connectionRetryStrategy_ = null; + if (connectionRetryStrategyBuilder_ != null) { + connectionRetryStrategyBuilder_.dispose(); + connectionRetryStrategyBuilder_ = null; + } + onChanged(); + return this; + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder + getConnectionRetryStrategyBuilder() { + bitField0_ |= 0x00000040; + onChanged(); + return getConnectionRetryStrategyFieldBuilder().getBuilder(); + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder + getConnectionRetryStrategyOrBuilder() { + if (connectionRetryStrategyBuilder_ != null) { + return connectionRetryStrategyBuilder_.getMessageOrBuilder(); + } else { + return connectionRetryStrategy_ == null + ? connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance() + : connectionRetryStrategy_; + } + } + + /** .connection_request.ConnectionRetryStrategy connection_retry_strategy = 7; */ + private com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder> + getConnectionRetryStrategyFieldBuilder() { + if (connectionRetryStrategyBuilder_ == null) { + connectionRetryStrategyBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder>( + getConnectionRetryStrategy(), getParentForChildren(), isClean()); + connectionRetryStrategy_ = null; + } + return connectionRetryStrategyBuilder_; + } + + private connection_request.ConnectionRequestOuterClass.AuthenticationInfo authenticationInfo_; + private com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AuthenticationInfo, + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder, + connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder> + authenticationInfoBuilder_; + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return Whether the authenticationInfo field is set. + */ + public boolean hasAuthenticationInfo() { + return ((bitField0_ & 0x00000080) != 0); + } + + /** + * .connection_request.AuthenticationInfo authentication_info = 8; + * + * @return The authenticationInfo. + */ + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo + getAuthenticationInfo() { + if (authenticationInfoBuilder_ == null) { + return authenticationInfo_ == null + ? connection_request.ConnectionRequestOuterClass.AuthenticationInfo + .getDefaultInstance() + : authenticationInfo_; + } else { + return authenticationInfoBuilder_.getMessage(); + } + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public Builder setAuthenticationInfo( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo value) { + if (authenticationInfoBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + authenticationInfo_ = value; + } else { + authenticationInfoBuilder_.setMessage(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public Builder setAuthenticationInfo( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder + builderForValue) { + if (authenticationInfoBuilder_ == null) { + authenticationInfo_ = builderForValue.build(); + } else { + authenticationInfoBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public Builder mergeAuthenticationInfo( + connection_request.ConnectionRequestOuterClass.AuthenticationInfo value) { + if (authenticationInfoBuilder_ == null) { + if (((bitField0_ & 0x00000080) != 0) + && authenticationInfo_ != null + && authenticationInfo_ + != connection_request.ConnectionRequestOuterClass.AuthenticationInfo + .getDefaultInstance()) { + getAuthenticationInfoBuilder().mergeFrom(value); + } else { + authenticationInfo_ = value; + } + } else { + authenticationInfoBuilder_.mergeFrom(value); + } + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public Builder clearAuthenticationInfo() { + bitField0_ = (bitField0_ & ~0x00000080); + authenticationInfo_ = null; + if (authenticationInfoBuilder_ != null) { + authenticationInfoBuilder_.dispose(); + authenticationInfoBuilder_ = null; + } + onChanged(); + return this; + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder + getAuthenticationInfoBuilder() { + bitField0_ |= 0x00000080; + onChanged(); + return getAuthenticationInfoFieldBuilder().getBuilder(); + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + public connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder + getAuthenticationInfoOrBuilder() { + if (authenticationInfoBuilder_ != null) { + return authenticationInfoBuilder_.getMessageOrBuilder(); + } else { + return authenticationInfo_ == null + ? connection_request.ConnectionRequestOuterClass.AuthenticationInfo + .getDefaultInstance() + : authenticationInfo_; + } + } + + /** .connection_request.AuthenticationInfo authentication_info = 8; */ + private com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AuthenticationInfo, + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder, + connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder> + getAuthenticationInfoFieldBuilder() { + if (authenticationInfoBuilder_ == null) { + authenticationInfoBuilder_ = + new com.google.protobuf.SingleFieldBuilderV3< + connection_request.ConnectionRequestOuterClass.AuthenticationInfo, + connection_request.ConnectionRequestOuterClass.AuthenticationInfo.Builder, + connection_request.ConnectionRequestOuterClass.AuthenticationInfoOrBuilder>( + getAuthenticationInfo(), getParentForChildren(), isClean()); + authenticationInfo_ = null; + } + return authenticationInfoBuilder_; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:connection_request.ConnectionRequest) + } + + // @@protoc_insertion_point(class_scope:connection_request.ConnectionRequest) + private static final connection_request.ConnectionRequestOuterClass.ConnectionRequest + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = new connection_request.ConnectionRequestOuterClass.ConnectionRequest(); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRequest + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRequest + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + public interface ConnectionRetryStrategyOrBuilder + extends + // @@protoc_insertion_point(interface_extends:connection_request.ConnectionRetryStrategy) + com.google.protobuf.MessageOrBuilder { + + /** + * uint32 number_of_retries = 1; + * + * @return The numberOfRetries. + */ + int getNumberOfRetries(); + + /** + * uint32 factor = 2; + * + * @return The factor. + */ + int getFactor(); + + /** + * uint32 exponent_base = 3; + * + * @return The exponentBase. + */ + int getExponentBase(); + } + + /** Protobuf type {@code connection_request.ConnectionRetryStrategy} */ + public static final class ConnectionRetryStrategy extends com.google.protobuf.GeneratedMessageV3 + implements + // @@protoc_insertion_point(message_implements:connection_request.ConnectionRetryStrategy) + ConnectionRetryStrategyOrBuilder { + private static final long serialVersionUID = 0L; + + // Use ConnectionRetryStrategy.newBuilder() to construct. + private ConnectionRetryStrategy(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + + private ConnectionRetryStrategy() {} + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance(UnusedPrivateParameter unused) { + return new ConnectionRetryStrategy(); + } + + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRetryStrategy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRetryStrategy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.class, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder.class); + } + + public static final int NUMBER_OF_RETRIES_FIELD_NUMBER = 1; + private int numberOfRetries_ = 0; + + /** + * uint32 number_of_retries = 1; + * + * @return The numberOfRetries. + */ + @java.lang.Override + public int getNumberOfRetries() { + return numberOfRetries_; + } + + public static final int FACTOR_FIELD_NUMBER = 2; + private int factor_ = 0; + + /** + * uint32 factor = 2; + * + * @return The factor. + */ + @java.lang.Override + public int getFactor() { + return factor_; + } + + public static final int EXPONENT_BASE_FIELD_NUMBER = 3; + private int exponentBase_ = 0; + + /** + * uint32 exponent_base = 3; + * + * @return The exponentBase. + */ + @java.lang.Override + public int getExponentBase() { + return exponentBase_; + } + + private byte memoizedIsInitialized = -1; + + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { + if (numberOfRetries_ != 0) { + output.writeUInt32(1, numberOfRetries_); + } + if (factor_ != 0) { + output.writeUInt32(2, factor_); + } + if (exponentBase_ != 0) { + output.writeUInt32(3, exponentBase_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (numberOfRetries_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(1, numberOfRetries_); + } + if (factor_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(2, factor_); + } + if (exponentBase_ != 0) { + size += com.google.protobuf.CodedOutputStream.computeUInt32Size(3, exponentBase_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj + instanceof connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy)) { + return super.equals(obj); + } + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy other = + (connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy) obj; + + if (getNumberOfRetries() != other.getNumberOfRetries()) return false; + if (getFactor() != other.getFactor()) return false; + if (getExponentBase() != other.getExponentBase()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + NUMBER_OF_RETRIES_FIELD_NUMBER; + hash = (53 * hash) + getNumberOfRetries(); + hash = (37 * hash) + FACTOR_FIELD_NUMBER; + hash = (53 * hash) + getFactor(); + hash = (37 * hash) + EXPONENT_BASE_FIELD_NUMBER; + hash = (53 * hash) + getExponentBase(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy 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 connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + 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 connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + com.google.protobuf.CodedInputStream input) throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3.parseWithIOException( + PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { + return newBuilder(); + } + + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + + public static Builder newBuilder( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + + @java.lang.Override + 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; + } + + /** Protobuf type {@code connection_request.ConnectionRetryStrategy} */ + public static final class Builder + extends com.google.protobuf.GeneratedMessageV3.Builder + implements + // @@protoc_insertion_point(builder_implements:connection_request.ConnectionRetryStrategy) + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRetryStrategy_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRetryStrategy_fieldAccessorTable + .ensureFieldAccessorsInitialized( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.class, + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.Builder + .class); + } + + // Construct using + // connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy.newBuilder() + private Builder() {} + + private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + } + + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + numberOfRetries_ = 0; + factor_ = 0; + exponentBase_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { + return connection_request.ConnectionRequestOuterClass + .internal_static_connection_request_ConnectionRetryStrategy_descriptor; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getDefaultInstanceForType() { + return connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance(); + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy build() { + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy result = + buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy buildPartial() { + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy result = + new connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy(this); + if (bitField0_ != 0) { + buildPartial0(result); + } + onBuilt(); + return result; + } + + private void buildPartial0( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.numberOfRetries_ = numberOfRetries_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.factor_ = factor_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.exponentBase_ = exponentBase_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.setField(field, value); + } + + @java.lang.Override + public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + + @java.lang.Override + public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, + java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { + return super.addRepeatedField(field, value); + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other + instanceof connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy) { + return mergeFrom( + (connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy) other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom( + connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy other) { + if (other + == connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + .getDefaultInstance()) return this; + if (other.getNumberOfRetries() != 0) { + setNumberOfRetries(other.getNumberOfRetries()); + } + if (other.getFactor() != 0) { + setFactor(other.getFactor()); + } + if (other.getExponentBase() != 0) { + setExponentBase(other.getExponentBase()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: + { + numberOfRetries_ = input.readUInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: + { + factor_ = input.readUInt32(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: + { + exponentBase_ = input.readUInt32(); + bitField0_ |= 0x00000004; + break; + } // case 24 + default: + { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + + private int bitField0_; + + private int numberOfRetries_; + + /** + * uint32 number_of_retries = 1; + * + * @return The numberOfRetries. + */ + @java.lang.Override + public int getNumberOfRetries() { + return numberOfRetries_; + } + + /** + * uint32 number_of_retries = 1; + * + * @param value The numberOfRetries to set. + * @return This builder for chaining. + */ + public Builder setNumberOfRetries(int value) { + + numberOfRetries_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + /** + * uint32 number_of_retries = 1; + * + * @return This builder for chaining. + */ + public Builder clearNumberOfRetries() { + bitField0_ = (bitField0_ & ~0x00000001); + numberOfRetries_ = 0; + onChanged(); + return this; + } + + private int factor_; + + /** + * uint32 factor = 2; + * + * @return The factor. + */ + @java.lang.Override + public int getFactor() { + return factor_; + } + + /** + * uint32 factor = 2; + * + * @param value The factor to set. + * @return This builder for chaining. + */ + public Builder setFactor(int value) { + + factor_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + + /** + * uint32 factor = 2; + * + * @return This builder for chaining. + */ + public Builder clearFactor() { + bitField0_ = (bitField0_ & ~0x00000002); + factor_ = 0; + onChanged(); + return this; + } + + private int exponentBase_; + + /** + * uint32 exponent_base = 3; + * + * @return The exponentBase. + */ + @java.lang.Override + public int getExponentBase() { + return exponentBase_; + } + + /** + * uint32 exponent_base = 3; + * + * @param value The exponentBase to set. + * @return This builder for chaining. + */ + public Builder setExponentBase(int value) { + + exponentBase_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + + /** + * uint32 exponent_base = 3; + * + * @return This builder for chaining. + */ + public Builder clearExponentBase() { + bitField0_ = (bitField0_ & ~0x00000004); + exponentBase_ = 0; + onChanged(); + return this; + } + + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + // @@protoc_insertion_point(builder_scope:connection_request.ConnectionRetryStrategy) + } + + // @@protoc_insertion_point(class_scope:connection_request.ConnectionRetryStrategy) + private static final connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + DEFAULT_INSTANCE; + + static { + DEFAULT_INSTANCE = + new connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy(); + } + + public static connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser PARSER = + new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConnectionRetryStrategy parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException() + .setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public connection_request.ConnectionRequestOuterClass.ConnectionRetryStrategy + getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_connection_request_AddressInfo_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_connection_request_AddressInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_connection_request_AuthenticationInfo_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_connection_request_AuthenticationInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_connection_request_ConnectionRequest_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_connection_request_ConnectionRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_connection_request_ConnectionRetryStrategy_descriptor; + private static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_connection_request_ConnectionRetryStrategy_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\030connection_request.proto\022\022connection_r" + + "equest\")\n\013AddressInfo\022\014\n\004host\030\001 \001(\t\022\014\n\004p" + + "ort\030\002 \001(\r\"8\n\022AuthenticationInfo\022\020\n\010passw" + + "ord\030\001 \001(\t\022\020\n\010username\030\002 \001(\t\"\265\003\n\021Connecti" + + "onRequest\0222\n\taddresses\030\001 \003(\0132\037.connectio" + + "n_request.AddressInfo\022-\n\010tls_mode\030\002 \001(\0162" + + "\033.connection_request.TlsMode\022\034\n\024cluster_" + + "mode_enabled\030\003 \001(\010\022\030\n\020response_timeout\030\004" + + " \001(\r\022\037\n\027client_creation_timeout\030\005 \001(\r\022O\n" + + "\032read_from_replica_strategy\030\006 \001(\0162+.conn" + + "ection_request.ReadFromReplicaStrategy\022N" + + "\n\031connection_retry_strategy\030\007 \001(\0132+.conn" + + "ection_request.ConnectionRetryStrategy\022C" + + "\n\023authentication_info\030\010 \001(\0132&.connection" + + "_request.AuthenticationInfo\"[\n\027Connectio" + + "nRetryStrategy\022\031\n\021number_of_retries\030\001 \001(" + + "\r\022\016\n\006factor\030\002 \001(\r\022\025\n\rexponent_base\030\003 \001(\r" + + "*c\n\027ReadFromReplicaStrategy\022\025\n\021AlwaysFro" + + "mPrimary\020\000\022\016\n\nRoundRobin\020\001\022\021\n\rLowestLate" + + "ncy\020\002\022\016\n\nAZAffinity\020\003*4\n\007TlsMode\022\t\n\005NoTl" + + "s\020\000\022\r\n\tSecureTls\020\001\022\017\n\013InsecureTls\020\002b\006pro" + + "to3" + }; + descriptor = + com.google.protobuf.Descriptors.FileDescriptor.internalBuildGeneratedFileFrom( + descriptorData, new com.google.protobuf.Descriptors.FileDescriptor[] {}); + internal_static_connection_request_AddressInfo_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_connection_request_AddressInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_connection_request_AddressInfo_descriptor, + new java.lang.String[] { + "Host", "Port", + }); + internal_static_connection_request_AuthenticationInfo_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_connection_request_AuthenticationInfo_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_connection_request_AuthenticationInfo_descriptor, + new java.lang.String[] { + "Password", "Username", + }); + internal_static_connection_request_ConnectionRequest_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_connection_request_ConnectionRequest_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_connection_request_ConnectionRequest_descriptor, + new java.lang.String[] { + "Addresses", + "TlsMode", + "ClusterModeEnabled", + "ResponseTimeout", + "ClientCreationTimeout", + "ReadFromReplicaStrategy", + "ConnectionRetryStrategy", + "AuthenticationInfo", + }); + internal_static_connection_request_ConnectionRetryStrategy_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_connection_request_ConnectionRetryStrategy_fieldAccessorTable = + new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_connection_request_ConnectionRetryStrategy_descriptor, + new java.lang.String[] { + "NumberOfRetries", "Factor", "ExponentBase", + }); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/java/src/lib.rs b/java/src/lib.rs index dbd9c5c487..5751010912 100644 --- a/java/src/lib.rs +++ b/java/src/lib.rs @@ -5,7 +5,7 @@ use jni::JNIEnv; use std::sync::mpsc; #[no_mangle] -pub extern "system" fn Java_RedisClient_startSocketListenerExternal<'local>( +pub extern "system" fn Java_javababushka_client_RedisClient_startSocketListenerExternal<'local>( mut env: JNIEnv<'local>, _class: JClass<'local>, callback: JObject<'local>