diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..72806b4 --- /dev/null +++ b/.gitignore @@ -0,0 +1,24 @@ +# Maven (examples) +target +dependency-reduced-pom.xml + +# IntelliJ IDEA +.idea +*.iml + +# Eclipse +.classpath +.project +.settings +bin + +# OS X +.DS_Store + +# log +logs/ +*.log + +#protobuf +example/build/* +test/test-integration/build/* \ No newline at end of file diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 261eeb9..0000000 --- a/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/README-zh.md b/README-zh.md new file mode 100644 index 0000000..7665946 --- /dev/null +++ b/README-zh.md @@ -0,0 +1,155 @@ +## 如何使用java sdk +### 1. import sdk +对于 Maven 项目,将以下配置添加进 `pom.xml` 文件: +```xml + + ... + + ... + + io.mosn.layotto + runtime-sdk-parent + 1.0.0 + + ... + + ... + +``` + +### 2. 运行 examples 示例 +可以本地部署redis和Layotto,然后运行java应用示例,通过java sdk调Layotto,Layotto转发给redis + +#### 第一步:部署redis + +1. 取最新版的 Redis 镜像。 + 这里我们拉取官方的最新版本的镜像: + +```shell +docker pull redis:latest +``` + +2. 查看本地镜像 + 使用以下命令来查看是否已安装了 redis: + +```shell +docker images +``` + +3. 运行容器 + +安装完成后,我们可以使用以下命令来运行 redis 容器: + +```shell +docker run -itd --name redis-test -p 6380:6379 redis +``` + +参数说明: + +-p 6380:6379:映射容器服务的 6379 端口到宿主机的 6380 端口。外部可以直接通过宿主机ip:6380 访问到 Redis 的服务。 + +#### 第二步:构建并运行Layotto + +clone仓库到本地: + +```sh +git clone https://github.com/mosn/layotto.git +``` + +构建并运行Layotto: + +```bash +# make sure you replace this` ${projectpath}` with your own project path. +cd ${projectpath}/cmd/layotto +go build +./layotto start -c ../../configs/config_redis.json +``` + +构建java-sdk [Maven](https://maven.apache.org/install.html) (Apache Maven version 3.x) 项目: + +```sh +# make sure you replace this` ${projectpath}` with your own project path. +cd ${projectpath}/sdk/java-sdk +mvn clean install +``` + +#### 第三步:运行java sdk示例 +通过以下Examples示例来了解如何使用SDK: +* [Hello world](./examples/src/test/java/io/mosn/layotto/examples/helloworld) +* [State management](./examples/src/test/java/io/mosn/layotto/examples/state) +* [Pubsub API](./examples/src/test/java/io/mosn/layotto/examples/pubsub) +* [File API](./examples/src/test/java/io/mosn/layotto/examples/file) + +## java sdk开发指南 +### java sdk职责 +1. sdk负责对Layotto的grpc API进行封装、不应该有任何中间件的定制逻辑,比如不应该出现redis、rocketmq等产品相关的逻辑。 + +2. sdk需要把所有跟通信协议相关的东西(比如proto编译出来的stub类)屏蔽掉,请勿让public方法暴露出任何跟协议相关的东西,最好protected方法也不暴露proto相关的东西。 + 这么做是因为将来可能改grpc API的package路径,甚至哪天不用grpc了(谁知道呢)。总之请让用户不用关心协议。 + +举个例子, state API对应有个`deleteState`方法,需要传`DeleteStateRequest`对象。 +```java + + /** + * Delete a state. + * + * @param request Request to delete a state. + */ + void deleteState(DeleteStateRequest request); + +``` +这个`DeleteStateRequest`是sdk定义的,其实sdk会把它转成 `RuntimeProto.DeleteStateRequest` (proto编译出来的类) 。 + +你可能会问:为什么不能直接传`RuntimeProto.DeleteStateRequest` 呢? + +这就是上面说的原因,sdk需要封装掉协议相关的东西 + +### 想为某个grpc API提供java sdk,需要做哪些事情? +举个例子,grpc API里添加了file API,现在想为java sdk开发file API相关功能,需要做哪些事情? + +1. 先找个java sdk的demo跑起来,然后看懂java sdk是怎么创建对象、怎么调用的。其实java sdk就是把grpc包了一层,封装掉grpc的一些stub类,逻辑不多。 + +2. 参考pr [feat(java-sdk): java sdk support File API](https://github.com/mosn/layotto/pull/325) . 这个pr 给java sdk添加了file API相关功能 + +### 如何格式化 java sdk 代码 +提交pull request之前先用maven编译一下 + +```shell +mvn clean compile +``` +会自动格式化您的代码 + +### 如何将proto文件编译成java代码 + +#### 1. 下载编译工具 [protoc](https://github.com/protocolbuffers/protobuf/releases) +my protoc version: +```shell +$ protoc --version +libprotoc 3.11.2 +``` + +#### 2. 修改对应`proto`文件生成类名包名等信息 +(需先修改文件内部service名) +`spec/proto/runtime/v1/appcallback.proto` : +```protobuf +option java_outer_classname = "AppCallbackProto"; +option java_package = "spec.proto.runtime.v1"; +``` +`spec/proto/runtime/v1/runtime.proto` : +```protobuf +option java_outer_classname = "RuntimeProto"; +option java_package = "spec.proto.runtime.v1"; +``` + +#### 3. 编译其对应`JAVA`文件 +```shell +cd ${your PROJECT path}/spec/proto/runtime/v1 +protoc -I=. --java_out=../../../../sdk/java-sdk/sdk/src/main/java/ runtime.proto +protoc -I=. --java_out=../../../../sdk/java-sdk/sdk/src/main/java/ appcallback.proto +``` + +[comment]: <> (PS: 建议用maven插件`protoc-gen-grpc-java`生成protobuf和grpc的java代码) + +[comment]: <> (如果您在使用 [IntelliJ IDEA](https://www.jetbrains.com/help/idea/discover-intellij-idea.html) ,双击 Maven插件中的 `compile` , IDE 会自动帮你编译 proto 文件:) + +[comment]: <> (![img.png](img.png)) diff --git a/README.md b/README.md new file mode 100644 index 0000000..ac984bd --- /dev/null +++ b/README.md @@ -0,0 +1,99 @@ +[中文](./README-zh.md) +## How to use java sdk +### 1. import sdk +For a Maven project, add the following to your `pom.xml` file: +```xml + + ... + + ... + + io.mosn.layotto + runtime-sdk-parent + 1.0.0 + + ... + + ... + +``` + +### 2. Run the examples +Clone this repository including the submodules: + +```sh +git clone https://github.com/mosn/layotto.git +``` + +Build and run Layotto: + +```bash +# make sure you replace this` ${projectpath}` with your own project path. +cd ${projectpath}/cmd/layotto +go build +./layotto start -c ../../configs/config_redis.json +``` + +Then head over to build the java-sdk [Maven](https://maven.apache.org/install.html) (Apache Maven version 3.x) project: + +```sh +# make sure you replace this` ${projectpath}` with your own project path. +cd ${projectpath}/sdk/java-sdk +mvn clean install +``` + + + + +Try the following examples to learn more about this SDK: +* [Hello world](./examples/src/test/java/io/mosn/layotto/examples/helloworld) +* [State management](./examples/src/test/java/io/mosn/layotto/examples/state) +* [Pubsub API](./examples/src/test/java/io/mosn/layotto/examples/pubsub) +* [File API](./examples/src/test/java/io/mosn/layotto/examples/file) + +## java sdk developer guide +### How to format java sdk code +Compile before submit your pull request: + +```shell +mvn clean compile +``` +It will format your code automatically. + +### How to generate a Java PROTO file + +#### 1. Download proto compiler [protoc](https://github.com/protocolbuffers/protobuf/releases) +my protoc version: +```shell +$ protoc --version +libprotoc 3.11.2 +``` + +#### 2. Check `option` fields in these proto files +Make sure these `option` fields have been configurated. + +spec/proto/runtime/v1/appcallback.proto : +```protobuf +option java_outer_classname = "AppCallbackProto"; +option java_package = "spec.proto.runtime.v1"; +``` + +spec/proto/runtime/v1/runtime.proto : +```protobuf +option java_outer_classname = "RuntimeProto"; +option java_package = "spec.proto.runtime.v1"; +``` + +#### 3. Compile them into corresponding `JAVA` files +```shell +# make sure you replace this `${your PROJECT path}` with your own project path. +cd ${your PROJECT path}/spec/proto/runtime/v1 +protoc -I=. --java_out=../../../../sdk/java-sdk/sdk/src/main/java/ runtime.proto +protoc -I=. --java_out=../../../../sdk/java-sdk/sdk/src/main/java/ appcallback.proto +``` + +[comment]: <> (PS: We recommend that you use the maven plugin `protoc-gen-grpc-java` to generate these protobuf and grpc related java code.) + +[comment]: <> (If you are using [IntelliJ IDEA](https://www.jetbrains.com/help/idea/discover-intellij-idea.html) ,just double click `compile` in the Maven tab and the IDE will generate proto files automatically:) + +[comment]: <> (![img.png](img.png)) diff --git a/examples/pom.xml b/examples/pom.xml new file mode 100644 index 0000000..015e86b --- /dev/null +++ b/examples/pom.xml @@ -0,0 +1,60 @@ + + + 4.0.0 + + + runtime-sdk-parent + io.mosn.layotto + 1.1.0-SNAPSHOT + + + examples + + + + io.mosn.layotto + runtime-sdk + + + + + src/main/java + + + src/main/resources + false + + **/** + + + + src/test/java + + + src/test/resources + false + + **/** + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + + jar + + + + + + + \ No newline at end of file diff --git a/examples/src/test/java/io/mosn/layotto/examples/file/File.java b/examples/src/test/java/io/mosn/layotto/examples/file/File.java new file mode 100644 index 0000000..43f2fc1 --- /dev/null +++ b/examples/src/test/java/io/mosn/layotto/examples/file/File.java @@ -0,0 +1,133 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.examples.file; + +import io.mosn.layotto.v1.RuntimeClientBuilder; +import io.mosn.layotto.v1.config.RuntimeProperties; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import spec.sdk.runtime.v1.client.RuntimeClient; +import spec.sdk.runtime.v1.domain.file.DelFileRequest; +import spec.sdk.runtime.v1.domain.file.FileInfo; +import spec.sdk.runtime.v1.domain.file.GetFileRequest; +import spec.sdk.runtime.v1.domain.file.GetFileResponse; +import spec.sdk.runtime.v1.domain.file.GetMetaRequest; +import spec.sdk.runtime.v1.domain.file.GetMeteResponse; +import spec.sdk.runtime.v1.domain.file.ListFileRequest; +import spec.sdk.runtime.v1.domain.file.ListFileResponse; +import spec.sdk.runtime.v1.domain.file.PutFileRequest; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +/** + * Specially + *

+ * 1. add `"local:{}` to "files" node in layotto/configs/config_file.json + * 2. start server by `./layotto start -c ../../configs/config_file.json` + */ +public class File { + + private static final Logger logger = LoggerFactory.getLogger(File.class.getName()); + + static String storeName = "local"; + static String fileName = "/tmp/test.log"; + + public static void main(String[] args) throws Exception { + + RuntimeClient client = new RuntimeClientBuilder() + .withPort(RuntimeProperties.DEFAULT_PORT) + .build(); + + putFile(client); + getFile(client); + listFile(client); + getFileMeta(client); + delFile(client); + } + + public static void putFile(RuntimeClient client) throws Exception { + + PutFileRequest request = new PutFileRequest(); + request.setStoreName(storeName); + request.setFileName(fileName); + + Map meta = new HashMap<>(); + meta.put("FileMode", "521"); + meta.put("FileFlag", "0777"); + request.setMetaData(meta); + + request.setIn(new ByteArrayInputStream("hello world".getBytes())); + + client.putFile(request, 3000); + } + + public static void getFile(RuntimeClient client) throws Exception { + + GetFileRequest request = new GetFileRequest(); + request.setStoreName(storeName); + request.setFileName(fileName); + + Map meta = new HashMap<>(); + meta.put("k1", "v1"); + request.setMetaData(meta); + + GetFileResponse resp = client.getFile(request, 3000); + + InputStream reader = resp.getIn(); + + byte[] buf = new byte[128]; + for (int len = reader.read(buf); len > 0; len = reader.read(buf)) { + logger.info(new String(buf, 0, len)); + } + } + + public static void delFile(RuntimeClient client) throws Exception { + + DelFileRequest request = new DelFileRequest(); + request.setStoreName(storeName); + request.setFileName(fileName); + + client.delFile(request, 3000); + } + + public static void listFile(RuntimeClient client) throws Exception { + + ListFileRequest request = new ListFileRequest(); + request.setStoreName(storeName); + request.setMarker("test.log"); + request.setName("/tmp"); + request.setPageSize(10); + + ListFileResponse resp = client.listFile(request, 3000); + + for (FileInfo f : resp.getFiles()) { + logger.info(f.getFileName()); + } + } + + public static void getFileMeta(RuntimeClient client) throws Exception { + + GetMetaRequest request = new GetMetaRequest(); + request.setStoreName(storeName); + request.setFileName(fileName); + + GetMeteResponse response = client.getFileMeta(request, 3000); + logger.info(response.getLastModified()); + logger.info("" + response.getMeta().size()); + } +} diff --git a/examples/src/test/java/io/mosn/layotto/examples/helloworld/Hello.java b/examples/src/test/java/io/mosn/layotto/examples/helloworld/Hello.java new file mode 100644 index 0000000..da35ec3 --- /dev/null +++ b/examples/src/test/java/io/mosn/layotto/examples/helloworld/Hello.java @@ -0,0 +1,34 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.examples.helloworld; + +import io.mosn.layotto.v1.RuntimeClientBuilder; +import io.mosn.layotto.v1.config.RuntimeProperties; +import spec.sdk.runtime.v1.client.RuntimeClient; + +public class Hello { + + public static void main(String[] args) { + RuntimeClient client = new RuntimeClientBuilder() + .withPort(RuntimeProperties.DEFAULT_PORT) + .build(); + + String resp = client.sayHello("helloworld"); + if (!"greeting, helloworld".equals(resp)) { + throw new RuntimeException("Unexpected result:" + resp); + } + System.out.println(resp); + } +} diff --git a/examples/src/test/java/io/mosn/layotto/examples/pubsub/publisher/Publisher.java b/examples/src/test/java/io/mosn/layotto/examples/pubsub/publisher/Publisher.java new file mode 100644 index 0000000..e7b14d9 --- /dev/null +++ b/examples/src/test/java/io/mosn/layotto/examples/pubsub/publisher/Publisher.java @@ -0,0 +1,31 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.examples.pubsub.publisher; + +import io.mosn.layotto.v1.RuntimeClientBuilder; +import io.mosn.layotto.v1.config.RuntimeProperties; +import spec.sdk.runtime.v1.client.RuntimeClient; + +public class Publisher { + + public static void main(String[] args) { + RuntimeClient client = new RuntimeClientBuilder() + .withPort(RuntimeProperties.DEFAULT_PORT) + .build(); + + client.publishEvent("redis", "hello", "world".getBytes()); + client.publishEvent("redis", "topic1", "message1".getBytes()); + } +} diff --git a/examples/src/test/java/io/mosn/layotto/examples/pubsub/subscriber/Subscriber.java b/examples/src/test/java/io/mosn/layotto/examples/pubsub/subscriber/Subscriber.java new file mode 100644 index 0000000..887a64a --- /dev/null +++ b/examples/src/test/java/io/mosn/layotto/examples/pubsub/subscriber/Subscriber.java @@ -0,0 +1,56 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.examples.pubsub.subscriber; + +import com.alibaba.fastjson.JSON; +import io.mosn.layotto.examples.pubsub.subscriber.impl.RawSubscriber; +import io.mosn.layotto.v1.RuntimeServerGrpc; + +import java.util.concurrent.Semaphore; + +public class Subscriber { + + /** + * This is the entry point for this example app, which subscribes to a topic. + * + * @throws Exception An Exception on startup. + */ + public static void main(String[] args) throws Exception { + RuntimeServerGrpc srv = new RuntimeServerGrpc(9999); + RawSubscriber pubsub = new RawSubscriber("redis"); + pubsub.subscribe("hello", request -> { + String value = new String(request.getData()); + assertEquals(value, "world"); + System.out.println(JSON.toJSONString(request)); + }); + pubsub.subscribe("topic1", request -> { + String value = new String(request.getData()); + assertEquals(value, "message1"); + System.out.println(JSON.toJSONString(request)); + }); + srv.registerPubSubCallback(pubsub.getComponentName(), pubsub); + Semaphore sm = new Semaphore(0); + srv.start(); + sm.acquire(); + } + + private static void assertEquals(Object actualResult, Object expected) { + if (actualResult == expected || actualResult.equals(expected)) { + return; + } + String msg = "Unexpected result:" + actualResult; + throw new RuntimeException(msg); + } +} \ No newline at end of file diff --git a/examples/src/test/java/io/mosn/layotto/examples/pubsub/subscriber/impl/EventListener.java b/examples/src/test/java/io/mosn/layotto/examples/pubsub/subscriber/impl/EventListener.java new file mode 100644 index 0000000..8f1c523 --- /dev/null +++ b/examples/src/test/java/io/mosn/layotto/examples/pubsub/subscriber/impl/EventListener.java @@ -0,0 +1,22 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.examples.pubsub.subscriber.impl; + +import spec.sdk.runtime.v1.domain.pubsub.TopicEventRequest; + +public interface EventListener { + + void onEvent(TopicEventRequest request) throws Exception; +} diff --git a/examples/src/test/java/io/mosn/layotto/examples/pubsub/subscriber/impl/RawSubscriber.java b/examples/src/test/java/io/mosn/layotto/examples/pubsub/subscriber/impl/RawSubscriber.java new file mode 100644 index 0000000..3121c4e --- /dev/null +++ b/examples/src/test/java/io/mosn/layotto/examples/pubsub/subscriber/impl/RawSubscriber.java @@ -0,0 +1,87 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.examples.pubsub.subscriber.impl; + +import io.mosn.layotto.v1.callback.component.pubsub.Subscriber; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventRequest; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventResponse; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventResponseStatus; +import spec.sdk.runtime.v1.domain.pubsub.TopicSubscription; + +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Raw pubsub client. + */ +public class RawSubscriber implements Subscriber { + + private static final Logger LOG = LoggerFactory.getLogger(RawSubscriber.class); + + private final Map listeners = new ConcurrentHashMap<>(); + private final String componentName; + + public RawSubscriber(String pubsubName) { + componentName = pubsubName; + } + + @Override + public String getComponentName() { + return componentName; + } + + public void subscribe(String topic, EventListener listener) { + if (listeners.putIfAbsent(topic, listener) != null) { + throw new IllegalArgumentException("Listener for topic " + topic + " already exists!"); + } + } + + @Override + public Set listTopicSubscriptions() { + final HashSet subscriptions = new HashSet<>(); + for (String topic : listeners.keySet()) { + final TopicSubscription subscription = new TopicSubscription(); + subscription.setTopic(topic); + subscription.setPubsubName(componentName); + subscriptions.add(subscription); + } + return subscriptions; + } + + @Override + public TopicEventResponse onTopicEvent(TopicEventRequest request) { + final String topic = request.getTopic(); + final EventListener eventListener = listeners.get(topic); + if (eventListener == null) { + LOG.error("Cannot find listener for topic:[{}]", topic); + TopicEventResponse resp = new TopicEventResponse(); + resp.setStatus(TopicEventResponseStatus.DROP); + } + try { + eventListener.onEvent(request); + final TopicEventResponse response = new TopicEventResponse(); + response.setStatus(TopicEventResponseStatus.SUCCESS); + return response; + } catch (Exception e) { + final TopicEventResponse response = new TopicEventResponse(); + response.setStatus(TopicEventResponseStatus.RETRY); + return response; + } + } +} diff --git a/examples/src/test/java/io/mosn/layotto/examples/state/RedisCRUD.java b/examples/src/test/java/io/mosn/layotto/examples/state/RedisCRUD.java new file mode 100644 index 0000000..34e4b13 --- /dev/null +++ b/examples/src/test/java/io/mosn/layotto/examples/state/RedisCRUD.java @@ -0,0 +1,131 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.examples.state; + +import io.mosn.layotto.v1.RuntimeClientBuilder; +import io.mosn.layotto.v1.config.RuntimeProperties; +import spec.sdk.runtime.v1.client.RuntimeClient; +import spec.sdk.runtime.v1.domain.state.GetBulkStateRequest; +import spec.sdk.runtime.v1.domain.state.State; +import spec.sdk.runtime.v1.domain.state.TransactionalStateOperation; + +import java.util.ArrayList; +import java.util.List; + +public class RedisCRUD { + static String storeName = "redis"; + static String key1 = "key1"; + static String key2 = "key2"; + static String key3 = "key3"; + + public static void main(String[] args) { + // build RuntimeClient + RuntimeClient client = new RuntimeClientBuilder() + .withPort(RuntimeProperties.DEFAULT_PORT) + .build(); + // saveState + client.saveState(storeName, key1, "v11"); + // getState + State state = client.getState(storeName, key1, String.class); + assertEquals(state.getKey(), key1); + assertEquals(state.getValue(), "v11"); + System.out.println("get state key:" + state.getKey() + " value:" + state.getValue()); + + // deleteState + client.deleteState(storeName, key1); + + // getState + state = client.getState(storeName, key1, String.class); + assertEquals(state.getKey(), key1); + // TODO: currently Redis component can't tell the difference between null and 'non exist' + //assertEquals(state.getValue(), null); + assertEquals(state.getValue(), ""); + System.out.println("get state after delete. key:" + state.getKey() + " value:" + state.getValue()); + + // saveBulkState + List> list = new ArrayList<>(); + State state1 = new State<>(key1, "v1", null, null); + State state2 = new State<>(key2, "v2", null, null); + list.add(state2); + list.add(state1); + client.saveBulkState(storeName, list); + + // execute transaction + List> operationList = new ArrayList<>(); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key2, new TestClass(key2), ""))); + + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key3, "v3", ""))); + + client.executeStateTransaction(storeName, operationList); + + // getBulkState + List keys = new ArrayList<>(); + keys.add(key3); + keys.add(key1); + GetBulkStateRequest req = new GetBulkStateRequest(storeName, keys); + List> bulkState = client.getBulkState(req, String.class); + assertTrue(bulkState.size() == 2); + for (State st : bulkState) { + String key = st.getKey(); + if (key.equals(key1)) { + assertEquals(st.getValue(), "v1"); + } else if (key.equals(key3)) { + assertEquals(st.getValue(), "v3"); + } else { + throw new RuntimeException("Unexpected key:" + key); + } + } + + keys = new ArrayList<>(); + keys.add(key2); + req = new GetBulkStateRequest(storeName, keys); + List> resp = client.getBulkState(req, TestClass.class); + assertTrue(resp.size() == 1); + assertEquals(resp.get(0).getValue().name, key2); + + } + + private static void assertTrue(boolean b) { + if (!b) { + throw new RuntimeException("Assertion fail"); + } + } + + private static void assertEquals(String actualResult, String expected) { + if (actualResult == expected || actualResult.equals(expected)) { + return; + } + throw new RuntimeException("Unexpected result:" + actualResult); + } + + public static class TestClass { + String name; + + public TestClass(String name) { + this.name = name; + } + + /** + * Getter method for property name. + * + * @return property value of name + */ + public String getName() { + return name; + } + } +} diff --git a/img.png b/img.png new file mode 100644 index 0000000..a826585 Binary files /dev/null and b/img.png differ diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..d57ab0a --- /dev/null +++ b/pom.xml @@ -0,0 +1,263 @@ + + + 4.0.0 + + io.mosn.layotto + runtime-sdk-parent + 1.1.0-SNAPSHOT + pom + + runtime-sdk-parent + SDK for Runtime + https://github.com/mosn/layotto + + + sdk + examples + sdk-reactor + spec + + + + 3.17.2 + 1.34.1 + 1.7.30 + 1.2.69 + 4.13.1 + 3.11.2 + + + + + + + io.mosn.layotto + runtime-sdk + ${project.version} + + + io.mosn.layotto + runtime-spec-pb + ${project.version} + + + + com.alibaba + fastjson + ${fastjson.version} + + + + + org.slf4j + slf4j-api + ${slf4j.version} + + + + + io.grpc + grpc-all + ${grpc.version} + + + io.grpc + grpc-netty + ${grpc.version} + + + io.grpc + grpc-protobuf + ${grpc.version} + + + io.grpc + grpc-stub + ${grpc.version} + + + + org.mockito + mockito-core + ${mockito.version} + test + + + junit + junit + ${junit.version} + test + + + + + + + + + org.apache.maven.plugins + maven-install-plugin + 2.5.2 + + + org.apache.maven.plugins + maven-deploy-plugin + 2.8.2 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.6.0 + + 1.8 + 1.8 + + + + com.googlecode.maven-java-formatter-plugin + maven-java-formatter-plugin + 0.4 + + + + format + + + + + ${user.dir}/tools/codestyle/formatter.xml + UTF-8 + + spec/proto/runtime/v1/** + + + + + + com.mycila + license-maven-plugin + 3.0 + + + generate-sources + + remove + format + + + + + true +

${user.dir}/tools/codestyle/HEADER
+ + **/src/main/java/** + **/src/test/java/** + + true + + SLASHSTAR_STYLE + + + + + + + + + The Apache License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + seeflood + 349895584@qq.com + MOSN + https://mosn.io/ + + + MentosL + 1367654518@qq.com + MOSN + https://mosn.io/ + + + ZLBer + 1098294815@qq.com + MOSN + https://mosn.io/ + + + kevinten10 + http://www.kevinten.com/ + + + + + http://github.com/mosn/layotto + scm:git:https://github.com/mosn/layotto.git + + + + release + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.10.4 + + + attach-javadocs + + jar + + + + + + org.sonatype.plugins + nexus-staging-maven-plugin + 1.6.7 + true + + ossrh + https://s01.oss.sonatype.org/ + false + + + + org.apache.maven.plugins + maven-gpg-plugin + 1.6 + + + sign-artifacts + verify + + sign + + + + + + + + + ossrh + https://s01.oss.sonatype.org/content/repositories/snapshots + + + ossrh + https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + diff --git a/sdk-reactor/pom.xml b/sdk-reactor/pom.xml new file mode 100644 index 0000000..ae43a86 --- /dev/null +++ b/sdk-reactor/pom.xml @@ -0,0 +1,53 @@ + + + + 4.0.0 + + + io.mosn.layotto + runtime-sdk-parent + 1.1.0-SNAPSHOT + + + runtime-sdk-reactor + + runtime-sdk-reactor + reactor-style SDK for Runtime + jar + + + + io.mosn.layotto + runtime-spec-pb + + + org.slf4j + slf4j-api + + + io.projectreactor + reactor-core + 3.3.11.RELEASE + + + + com.fasterxml.jackson.core + jackson-databind + 2.11.3 + + + + com.squareup.okhttp3 + okhttp + 4.9.0 + + + + org.apache.tomcat + annotations-api + 6.0.53 + provided + + + diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/package-info.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/package-info.java new file mode 100644 index 0000000..3b6fc72 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/package-info.java @@ -0,0 +1,18 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * SDK JVM Client. + */ +package io.mosn.layotto.v1.client; \ No newline at end of file diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/AbstractLayottoReactorClient.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/AbstractLayottoReactorClient.java new file mode 100644 index 0000000..bca2ae6 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/AbstractLayottoReactorClient.java @@ -0,0 +1,300 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.client.reactor; + +import io.mosn.layotto.v1.serializer.LayottoObjectSerializer; +import reactor.core.publisher.Mono; +import spec.sdk.reactor.v1.domain.core.invocation.HttpExtension; +import spec.sdk.reactor.v1.domain.core.invocation.InvokeMethodRequest; +import spec.sdk.reactor.v1.domain.core.pubsub.PublishEventRequest; +import spec.sdk.reactor.v1.domain.core.state.DeleteStateRequest; +import spec.sdk.reactor.v1.domain.core.state.ExecuteStateTransactionRequest; +import spec.sdk.reactor.v1.domain.core.state.GetBulkStateRequest; +import spec.sdk.reactor.v1.domain.core.state.GetStateRequest; +import spec.sdk.reactor.v1.domain.core.state.SaveStateRequest; +import spec.sdk.reactor.v1.domain.core.state.State; +import spec.sdk.reactor.v1.domain.core.state.StateOptions; +import spec.sdk.reactor.v1.domain.core.state.TransactionalStateOperation; +import spec.sdk.reactor.v1.utils.TypeRef; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +abstract class AbstractLayottoReactorClient implements LayottoReactorClient { + + /** + * A utility class for serialize and deserialize the transient objects. + */ + protected LayottoObjectSerializer objectSerializer; + + /** + * A utility class for serialize and deserialize state objects. + */ + protected LayottoObjectSerializer stateSerializer; + + /** + * Common constructor for implementations of this class. + * + * @param objectSerializer Serializer for transient request/response objects. + * @param stateSerializer Serializer for state objects. + */ + AbstractLayottoReactorClient(LayottoObjectSerializer objectSerializer, + LayottoObjectSerializer stateSerializer) { + this.objectSerializer = objectSerializer; + this.stateSerializer = stateSerializer; + } + + /** + * {@inheritDoc} + */ + @Override + public Mono publishEvent(String pubsubName, String topicName, Object data) { + return this.publishEvent(pubsubName, topicName, data, null); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono publishEvent(String pubsubName, String topicName, Object data, Map metadata) { + PublishEventRequest req = new PublishEventRequest(pubsubName, topicName, data) + .setMetadata(metadata); + return this.publishEvent(req).then(); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono invokeMethod(String appId, + String methodName, + Object data, + HttpExtension httpExtension, + Map metadata, + TypeRef type) { + InvokeMethodRequest req = new InvokeMethodRequest(appId, methodName) + .setBody(data) + .setHttpExtension(httpExtension) + .setContentType(objectSerializer.getContentType()); + return this.invokeMethod(req, type); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono invokeMethod(String appId, + String methodName, + Object request, + HttpExtension httpExtension, + Map metadata, + Class clazz) { + return this.invokeMethod(appId, methodName, request, httpExtension, metadata, TypeRef.get(clazz)); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono invokeMethod(String appId, String methodName, HttpExtension httpExtension, + Map metadata, TypeRef type) { + return this.invokeMethod(appId, methodName, null, httpExtension, metadata, type); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono invokeMethod(String appId, String methodName, HttpExtension httpExtension, + Map metadata, Class clazz) { + return this.invokeMethod(appId, methodName, null, httpExtension, metadata, TypeRef.get(clazz)); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + TypeRef type) { + return this.invokeMethod(appId, methodName, request, httpExtension, null, type); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + Class clazz) { + return this.invokeMethod(appId, methodName, request, httpExtension, null, TypeRef.get(clazz)); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension) { + return this.invokeMethod(appId, methodName, request, httpExtension, null, TypeRef.BYTE_ARRAY).then(); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + Map metadata) { + return this.invokeMethod(appId, methodName, request, httpExtension, metadata, TypeRef.BYTE_ARRAY).then(); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono invokeMethod(String appId, String methodName, HttpExtension httpExtension, + Map metadata) { + return this.invokeMethod(appId, methodName, null, httpExtension, metadata, TypeRef.BYTE_ARRAY).then(); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono invokeMethod(String appId, String methodName, byte[] request, HttpExtension httpExtension, + Map metadata) { + return this.invokeMethod(appId, methodName, request, httpExtension, metadata, TypeRef.BYTE_ARRAY); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono> getState(String storeName, State state, TypeRef type) { + return this.getState(storeName, state.getKey(), state.getOptions(), type); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono> getState(String storeName, State state, Class clazz) { + return this.getState(storeName, state.getKey(), state.getOptions(), TypeRef.get(clazz)); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono> getState(String storeName, String key, TypeRef type) { + return this.getState(storeName, key, null, type); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono> getState(String storeName, String key, Class clazz) { + return this.getState(storeName, key, null, TypeRef.get(clazz)); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono> getState(String storeName, String key, StateOptions options, TypeRef type) { + GetStateRequest request = new GetStateRequest(storeName, key) + .setStateOptions(options); + return this.getState(request, type); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono> getState(String storeName, String key, StateOptions options, Class clazz) { + return this.getState(storeName, key, options, TypeRef.get(clazz)); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono>> getBulkState(String storeName, List keys, TypeRef type) { + return this.getBulkState(new GetBulkStateRequest(storeName, keys), type); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono>> getBulkState(String storeName, List keys, Class clazz) { + return this.getBulkState(storeName, keys, TypeRef.get(clazz)); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono executeStateTransaction(String storeName, List> operations) { + ExecuteStateTransactionRequest request = new ExecuteStateTransactionRequest(storeName) + .setOperations(operations); + return executeStateTransaction(request).then(); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono saveBulkState(String storeName, List> states) { + SaveStateRequest request = new SaveStateRequest(storeName) + .setStates(states); + return this.saveBulkState(request).then(); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono saveState(String storeName, String key, Object value) { + return this.saveState(storeName, key, null, value, null); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono saveState(String storeName, String key, String etag, Object value, StateOptions options) { + State state = new State<>(key, value, etag, options); + return this.saveBulkState(storeName, Collections.singletonList(state)); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono deleteState(String storeName, String key) { + return this.deleteState(storeName, key, null, null); + } + + /** + * {@inheritDoc} + */ + @Override + public Mono deleteState(String storeName, String key, String etag, StateOptions options) { + DeleteStateRequest request = new DeleteStateRequest(storeName, key) + .setEtag(etag) + .setStateOptions(options); + return deleteState(request).then(); + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/LayottoReactorClient.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/LayottoReactorClient.java new file mode 100644 index 0000000..dc8ea27 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/LayottoReactorClient.java @@ -0,0 +1,171 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.client.reactor; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import spec.sdk.reactor.v1.client.CloudRuntimesClient; +import spec.sdk.reactor.v1.domain.core.configuration.ConfigurationItem; +import spec.sdk.reactor.v1.domain.core.configuration.ConfigurationRequestItem; +import spec.sdk.reactor.v1.domain.core.configuration.SaveConfigurationRequest; +import spec.sdk.reactor.v1.domain.core.configuration.SubConfigurationResp; +import spec.sdk.reactor.v1.domain.core.invocation.HttpExtension; +import spec.sdk.reactor.v1.domain.core.invocation.InvokeMethodRequest; +import spec.sdk.reactor.v1.domain.core.pubsub.PublishEventRequest; +import spec.sdk.reactor.v1.domain.core.state.DeleteStateRequest; +import spec.sdk.reactor.v1.domain.core.state.ExecuteStateTransactionRequest; +import spec.sdk.reactor.v1.domain.core.state.GetBulkStateRequest; +import spec.sdk.reactor.v1.domain.core.state.GetStateRequest; +import spec.sdk.reactor.v1.domain.core.state.SaveStateRequest; +import spec.sdk.reactor.v1.domain.core.state.State; +import spec.sdk.reactor.v1.domain.core.state.StateOptions; +import spec.sdk.reactor.v1.domain.core.state.TransactionalStateOperation; +import spec.sdk.reactor.v1.utils.TypeRef; + +import java.util.List; +import java.util.Map; + +public interface LayottoReactorClient extends CloudRuntimesClient { + + @Override + Mono waitForSidecar(int timeoutInMilliseconds); + + @Override + Mono shutdown(); + + @Override + void close() throws Exception; + + @Override + Mono>> getConfiguration(ConfigurationRequestItem configurationRequestItem, + TypeRef type); + + @Override + Mono saveConfiguration(SaveConfigurationRequest saveConfigurationRequest); + + @Override + Mono deleteConfiguration(ConfigurationRequestItem configurationRequestItem); + + @Override + Flux> subscribeConfiguration(ConfigurationRequestItem configurationRequestItem, + TypeRef type); + + @Override + Mono invokeMethod(String appId, String methodName, Object data, HttpExtension httpExtension, + Map metadata, TypeRef type); + + @Override + Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + Map metadata, Class clazz); + + @Override + Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + TypeRef type); + + @Override + Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + Class clazz); + + @Override + Mono invokeMethod(String appId, String methodName, HttpExtension httpExtension, + Map metadata, TypeRef type); + + @Override + Mono invokeMethod(String appId, String methodName, HttpExtension httpExtension, + Map metadata, Class clazz); + + @Override + Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + Map metadata); + + @Override + Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension); + + @Override + Mono invokeMethod(String appId, String methodName, HttpExtension httpExtension, Map metadata); + + @Override + Mono invokeMethod(String appId, String methodName, byte[] request, HttpExtension httpExtension, + Map metadata); + + @Override + Mono invokeMethod(InvokeMethodRequest invokeMethodRequest, TypeRef type); + + @Override + Mono publishEvent(String pubsubName, String topicName, Object data); + + @Override + Mono publishEvent(String pubsubName, String topicName, Object data, Map metadata); + + @Override + Mono publishEvent(PublishEventRequest request); + + @Override + Mono> getState(String storeName, State state, TypeRef type); + + @Override + Mono> getState(String storeName, State state, Class clazz); + + @Override + Mono> getState(String storeName, String key, TypeRef type); + + @Override + Mono> getState(String storeName, String key, Class clazz); + + @Override + Mono> getState(String storeName, String key, StateOptions options, TypeRef type); + + @Override + Mono> getState(String storeName, String key, StateOptions options, Class clazz); + + @Override + Mono> getState(GetStateRequest request, TypeRef type); + + @Override + Mono>> getBulkState(String storeName, List keys, TypeRef type); + + @Override + Mono>> getBulkState(String storeName, List keys, Class clazz); + + @Override + Mono>> getBulkState(GetBulkStateRequest request, TypeRef type); + + @Override + Mono executeStateTransaction(String storeName, List> operations); + + @Override + Mono executeStateTransaction(ExecuteStateTransactionRequest request); + + @Override + Mono saveBulkState(String storeName, List> states); + + @Override + Mono saveBulkState(SaveStateRequest request); + + @Override + Mono saveState(String storeName, String key, Object value); + + @Override + Mono saveState(String storeName, String key, String etag, Object value, StateOptions options); + + @Override + Mono deleteState(String storeName, String key); + + @Override + Mono deleteState(String storeName, String key, String etag, StateOptions options); + + @Override + Mono deleteState(DeleteStateRequest request); +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/LayottoReactorClientBuilder.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/LayottoReactorClientBuilder.java new file mode 100644 index 0000000..ae51d48 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/LayottoReactorClientBuilder.java @@ -0,0 +1,148 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.client.reactor; + +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.mosn.layotto.v1.config.Properties; +import io.mosn.layotto.v1.serializer.DefaultObjectSerializer; +import io.mosn.layotto.v1.serializer.LayottoObjectSerializer; +import io.mosn.layotto.v1.value.LayottoApiProtocol; +import spec.proto.runtime.v1.RuntimeGrpc; + +import java.io.Closeable; + +/** + * A builder for the LayottoClient, Currently only gRPC Client will be supported. + */ +public class LayottoReactorClientBuilder { + + /** + * Determine if this builder will create GRPC clients instead of HTTP clients. + */ + private final LayottoApiProtocol apiProtocol; + + /** + * Serializer used for request and response objects in LayottoClient. + */ + private LayottoObjectSerializer objectSerializer; + + /** + * Serializer used for state objects in LayottoClient. + */ + private LayottoObjectSerializer stateSerializer; + + /** + * Creates a constructor for LayottoClient. + *

+ * {@link DefaultObjectSerializer} is used for object and state serializers by default but is not recommended + * for production scenarios. + */ + public LayottoReactorClientBuilder() { + this.objectSerializer = new DefaultObjectSerializer(); + this.stateSerializer = new DefaultObjectSerializer(); + this.apiProtocol = Properties.API_PROTOCOL.get(); + } + + /** + * Sets the serializer for objects to be sent and received from Layotto. + * See {@link DefaultObjectSerializer} as possible serializer for non-production scenarios. + * + * @param objectSerializer Serializer for objects to be sent and received from Layotto. + * @return This instance. + */ + public LayottoReactorClientBuilder withObjectSerializer(LayottoObjectSerializer objectSerializer) { + if (objectSerializer == null) { + throw new IllegalArgumentException("Object serializer is required"); + } + + if (objectSerializer.getContentType() == null || objectSerializer.getContentType().isEmpty()) { + throw new IllegalArgumentException("Content Type should not be null or empty"); + } + + this.objectSerializer = objectSerializer; + return this; + } + + /** + * Sets the serializer for objects to be persisted. + * See {@link DefaultObjectSerializer} as possible serializer for non-production scenarios. + * + * @param stateSerializer Serializer for objects to be persisted. + * @return This instance. + */ + public LayottoReactorClientBuilder withStateSerializer(LayottoObjectSerializer stateSerializer) { + if (stateSerializer == null) { + throw new IllegalArgumentException("State serializer is required"); + } + + this.stateSerializer = stateSerializer; + return this; + } + + /** + * Build an instance of the Client based on the provided setup. + * + * @return an instance of the setup Client + * @throws java.lang.IllegalStateException if any required field is missing + */ + public LayottoReactorClient build() { + return buildLayottoClient(this.apiProtocol); + } + + /** + * Creates an instance of a Layotto Client based on the chosen protocol. + * + * @param protocol Layotto API's protocol. + * @return the GRPC Client. + * @throws java.lang.IllegalStateException if either host is missing or if port is missing or a negative number. + */ + private LayottoReactorClient buildLayottoClient(LayottoApiProtocol protocol) { + if (protocol == null) { + throw new IllegalStateException("Protocol is required."); + } + + switch (protocol) { + case GRPC: + return buildLayottoClientGrpc(); + default: + throw new IllegalStateException("Unsupported protocol: " + protocol.name()); + } + } + + /** + * Creates an instance of the GPRC Client. + * + * @return the GRPC Client. + * @throws java.lang.IllegalStateException if either host is missing or if port is missing or a negative number. + */ + private LayottoReactorClient buildLayottoClientGrpc() { + int port = Properties.GRPC_PORT.get(); + if (port <= 0) { + throw new IllegalArgumentException("Invalid port."); + } + ManagedChannel channel = ManagedChannelBuilder + .forAddress(Properties.SIDECAR_IP.get(), port) + .usePlaintext() + .build(); + Closeable closeableChannel = () -> { + if (channel != null && !channel.isShutdown()) { + channel.shutdown(); + } + }; + RuntimeGrpc.RuntimeStub asyncStub = RuntimeGrpc.newStub(channel); + return new LayottoReactorClientGrpc(this.objectSerializer, this.stateSerializer, closeableChannel, asyncStub); + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/LayottoReactorClientGrpc.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/LayottoReactorClientGrpc.java new file mode 100644 index 0000000..996502c --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/client/reactor/LayottoReactorClientGrpc.java @@ -0,0 +1,624 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.client.reactor; + +import com.google.common.base.Strings; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.grpc.stub.StreamObserver; +import io.mosn.layotto.v1.config.Properties; +import io.mosn.layotto.v1.exceptions.LayottoException; +import io.mosn.layotto.v1.serializer.LayottoObjectSerializer; +import io.mosn.layotto.v1.utils.GrpcWrapper; +import io.mosn.layotto.v1.utils.NetworkUtils; +import io.mosn.layotto.v1.value.Headers; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import reactor.core.publisher.MonoSink; +import reactor.util.context.Context; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.proto.runtime.v1.RuntimeProto; +import spec.sdk.reactor.v1.domain.core.configuration.ConfigurationItem; +import spec.sdk.reactor.v1.domain.core.configuration.ConfigurationRequestItem; +import spec.sdk.reactor.v1.domain.core.configuration.SaveConfigurationRequest; +import spec.sdk.reactor.v1.domain.core.configuration.SubConfigurationResp; +import spec.sdk.reactor.v1.domain.core.invocation.HttpExtension; +import spec.sdk.reactor.v1.domain.core.invocation.InvokeMethodRequest; +import spec.sdk.reactor.v1.domain.core.pubsub.PublishEventRequest; +import spec.sdk.reactor.v1.domain.core.state.DeleteStateRequest; +import spec.sdk.reactor.v1.domain.core.state.ExecuteStateTransactionRequest; +import spec.sdk.reactor.v1.domain.core.state.GetBulkStateRequest; +import spec.sdk.reactor.v1.domain.core.state.GetStateRequest; +import spec.sdk.reactor.v1.domain.core.state.SaveStateRequest; +import spec.sdk.reactor.v1.domain.core.state.State; +import spec.sdk.reactor.v1.domain.core.state.StateOptions; +import spec.sdk.reactor.v1.domain.core.state.TransactionalStateOperation; +import spec.sdk.reactor.v1.utils.TypeRef; + +import java.io.Closeable; +import java.io.IOException; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ExecutionException; +import java.util.function.Consumer; +import java.util.stream.Collectors; + +public class LayottoReactorClientGrpc extends AbstractLayottoReactorClient { + + /** + * The GRPC managed channel to be used. + */ + private final Closeable channel; + + /** + * The async gRPC stub. + */ + private final RuntimeGrpc.RuntimeStub asyncStub; + + /** + * Default access level constructor, in order to create an instance of this class. + * + * @param closeableChannel A closeable for a Managed GRPC channel + * @param asyncStub async gRPC stub + */ + LayottoReactorClientGrpc(LayottoObjectSerializer objectSerializer, + LayottoObjectSerializer stateSerializer, + Closeable closeableChannel, + RuntimeGrpc.RuntimeStub asyncStub) { + super(objectSerializer, stateSerializer); + this.channel = closeableChannel; + this.asyncStub = intercept(asyncStub); + } + + @Override + public Mono>> getConfiguration(ConfigurationRequestItem configurationRequestItem, + TypeRef type) { + // TODO: 2021/9/26 + return null; + } + + @Override + public Mono saveConfiguration(SaveConfigurationRequest saveConfigurationRequest) { + // TODO: 2021/9/26 + return null; + } + + @Override + public Mono deleteConfiguration(ConfigurationRequestItem configurationRequestItem) { + // TODO: 2021/9/26 + return null; + } + + @Override + public Flux> subscribeConfiguration(ConfigurationRequestItem configurationRequestItem, + TypeRef type) { + // TODO: 2021/9/26 + return null; + } + + @Override + public Mono invokeMethod(InvokeMethodRequest invokeMethodRequest, TypeRef type) { + try { + String appId = invokeMethodRequest.getAppId(); + String method = invokeMethodRequest.getMethod(); + Object body = invokeMethodRequest.getBody(); + HttpExtension httpExtension = invokeMethodRequest.getHttpExtension(); + RuntimeProto.InvokeServiceRequest envelope = this.buildInvokeServiceRequest( + httpExtension, + appId, + method, + body); + // Regarding missing metadata in method invocation for gRPC: + // gRPC to gRPC does not handle metadata in Layotto runtime proto. + // gRPC to HTTP does not map correctly in Layotto runtime as per https://github.com/layotto/layotto/issues/2342 + + return Mono.subscriberContext().flatMap( + context -> this.createMono( + it -> intercept(context, asyncStub).invokeService(envelope, it) + ) + ).flatMap( + it -> { + try { + return Mono.justOrEmpty(objectSerializer.deserialize(it.getData().getValue().toByteArray(), type)); + } catch (IOException e) { + throw LayottoException.propagate(e); + } + } + ); + } catch (Exception ex) { + return LayottoException.wrapMono(ex); + } + } + + @Override + public Mono publishEvent(PublishEventRequest request) { + try { + String pubsubName = request.getPubsubName(); + String topic = request.getTopic(); + Object data = request.getData(); + RuntimeProto.PublishEventRequest.Builder envelopeBuilder = RuntimeProto.PublishEventRequest.newBuilder() + .setTopic(topic) + .setPubsubName(pubsubName) + .setData(ByteString.copyFrom(objectSerializer.serialize(data))); + + // Content-type can be overwritten on a per-request basis. + // It allows CloudEvents to be handled differently, for example. + String contentType = request.getContentType(); + if (contentType == null || contentType.isEmpty()) { + contentType = objectSerializer.getContentType(); + } + envelopeBuilder.setDataContentType(contentType); + + Map metadata = request.getMetadata(); + if (metadata != null) { + envelopeBuilder.putAllMetadata(metadata); + } + + return Mono.subscriberContext().flatMap( + context -> + this.createMono( + it -> intercept(context, asyncStub).publishEvent(envelopeBuilder.build(), it) + ) + ).then(); + } catch (Exception ex) { + return LayottoException.wrapMono(ex); + } + } + + @Override + public Mono> getState(GetStateRequest request, TypeRef type) { + try { + final String stateStoreName = request.getStoreName(); + final String key = request.getKey(); + final StateOptions options = request.getStateOptions(); + final Map metadata = request.getMetadata(); + + if ((stateStoreName == null) || (stateStoreName.trim().isEmpty())) { + throw new IllegalArgumentException("State store name cannot be null or empty."); + } + if ((key == null) || (key.trim().isEmpty())) { + throw new IllegalArgumentException("Key cannot be null or empty."); + } + RuntimeProto.GetStateRequest.Builder builder = RuntimeProto.GetStateRequest.newBuilder() + .setStoreName(stateStoreName) + .setKey(key); + if (metadata != null) { + builder.putAllMetadata(metadata); + } + if (options != null && options.getConsistency() != null) { + builder.setConsistency(getGrpcStateConsistency(options)); + } + + RuntimeProto.GetStateRequest envelope = builder.build(); + + return Mono.subscriberContext().flatMap( + context -> + this.createMono( + it -> intercept(context, asyncStub).getState(envelope, it) + ) + ).map( + it -> { + try { + return buildStateKeyValue(it, key, options, type); + } catch (IOException ex) { + throw LayottoException.propagate(ex); + } + } + ); + } catch (Exception ex) { + return LayottoException.wrapMono(ex); + } + } + + @Override + public Mono>> getBulkState(GetBulkStateRequest request, TypeRef type) { + try { + final String stateStoreName = request.getStoreName(); + final List keys = request.getKeys(); + final int parallelism = request.getParallelism(); + final Map metadata = request.getMetadata(); + if ((stateStoreName == null) || (stateStoreName.trim().isEmpty())) { + throw new IllegalArgumentException("State store name cannot be null or empty."); + } + if (keys == null || keys.isEmpty()) { + throw new IllegalArgumentException("Key cannot be null or empty."); + } + + if (parallelism < 0) { + throw new IllegalArgumentException("Parallelism cannot be negative."); + } + RuntimeProto.GetBulkStateRequest.Builder builder = RuntimeProto.GetBulkStateRequest.newBuilder() + .setStoreName(stateStoreName) + .addAllKeys(keys) + .setParallelism(parallelism); + if (metadata != null) { + builder.putAllMetadata(metadata); + } + + RuntimeProto.GetBulkStateRequest envelope = builder.build(); + + return Mono.subscriberContext().flatMap( + context -> this.createMono(it -> intercept(context, asyncStub) + .getBulkState(envelope, it) + ) + ).map( + it -> + it + .getItemsList() + .stream() + .map(b -> { + try { + return buildStateKeyValue(b, type); + } catch (Exception e) { + throw LayottoException.propagate(e); + } + }) + .collect(Collectors.toList()) + ); + } catch (Exception ex) { + return LayottoException.wrapMono(ex); + } + } + + @Override + public Mono executeStateTransaction(ExecuteStateTransactionRequest request) { + try { + final String stateStoreName = request.getStateStoreName(); + final List> operations = request.getOperations(); + final Map metadata = request.getMetadata(); + if ((stateStoreName == null) || (stateStoreName.trim().isEmpty())) { + throw new IllegalArgumentException("State store name cannot be null or empty."); + } + RuntimeProto.ExecuteStateTransactionRequest.Builder builder = RuntimeProto.ExecuteStateTransactionRequest + .newBuilder(); + builder.setStoreName(stateStoreName); + if (metadata != null) { + builder.putAllMetadata(metadata); + } + for (TransactionalStateOperation operation : operations) { + RuntimeProto.TransactionalStateOperation.Builder operationBuilder = RuntimeProto.TransactionalStateOperation + .newBuilder(); + operationBuilder.setOperationType(operation.getOperation().toString().toLowerCase()); + operationBuilder.setRequest(buildStateRequest(operation.getRequest()).build()); + builder.addOperations(operationBuilder.build()); + } + RuntimeProto.ExecuteStateTransactionRequest req = builder.build(); + + return Mono.subscriberContext().flatMap( + context -> this.createMono(it -> intercept(context, asyncStub).executeStateTransaction(req, it)) + ).then(); + } catch (Exception e) { + return LayottoException.wrapMono(e); + } + } + + @Override + public Mono saveBulkState(SaveStateRequest request) { + try { + final String stateStoreName = request.getStoreName(); + final List> states = request.getStates(); + if ((stateStoreName == null) || (stateStoreName.trim().isEmpty())) { + throw new IllegalArgumentException("State store name cannot be null or empty."); + } + RuntimeProto.SaveStateRequest.Builder builder = RuntimeProto.SaveStateRequest.newBuilder(); + builder.setStoreName(stateStoreName); + for (State state : states) { + builder.addStates(buildStateRequest(state).build()); + } + RuntimeProto.SaveStateRequest req = builder.build(); + + return Mono.subscriberContext().flatMap( + context -> this.createMono(it -> intercept(context, asyncStub).saveState(req, it)) + ).then(); + } catch (Exception ex) { + return LayottoException.wrapMono(ex); + } + } + + @Override + public Mono deleteState(DeleteStateRequest request) { + try { + final String stateStoreName = request.getStateStoreName(); + final String key = request.getKey(); + final StateOptions options = request.getStateOptions(); + final String etag = request.getEtag(); + final Map metadata = request.getMetadata(); + + if ((stateStoreName == null) || (stateStoreName.trim().isEmpty())) { + throw new IllegalArgumentException("State store name cannot be null or empty."); + } + if ((key == null) || (key.trim().isEmpty())) { + throw new IllegalArgumentException("Key cannot be null or empty."); + } + + RuntimeProto.StateOptions.Builder optionBuilder = null; + if (options != null) { + optionBuilder = RuntimeProto.StateOptions.newBuilder(); + if (options.getConcurrency() != null) { + optionBuilder.setConcurrency(getGrpcStateConcurrency(options)); + } + if (options.getConsistency() != null) { + optionBuilder.setConsistency(getGrpcStateConsistency(options)); + } + } + RuntimeProto.DeleteStateRequest.Builder builder = RuntimeProto.DeleteStateRequest.newBuilder() + .setStoreName(stateStoreName) + .setKey(key); + if (metadata != null) { + builder.putAllMetadata(metadata); + } + if (etag != null) { + builder.setEtag(RuntimeProto.Etag.newBuilder().setValue(etag).build()); + } + + if (optionBuilder != null) { + builder.setOptions(optionBuilder.build()); + } + + RuntimeProto.DeleteStateRequest req = builder.build(); + + return Mono.subscriberContext().flatMap( + context -> this.createMono(it -> intercept(context, asyncStub).deleteState(req, it)) + ).then(); + } catch (Exception ex) { + return LayottoException.wrapMono(ex); + } + } + + /** + * Builds the object io.layotto.{@link RuntimeProto.InvokeServiceRequest} to be send based on the parameters. + * + * @param httpExtension Object for HttpExtension + * @param appId The application id to be invoked + * @param method The application method to be invoked + * @param body The body of the request to be send as part of the invocation + * @param The Type of the Body + * @return The object to be sent as part of the invocation. + * @throws IOException If there's an issue serializing the request. + */ + private RuntimeProto.InvokeServiceRequest buildInvokeServiceRequest( + HttpExtension httpExtension, + String appId, + String method, + K body) throws IOException { + if (httpExtension == null) { + throw new IllegalArgumentException("HttpExtension cannot be null. Use HttpExtension.NONE instead."); + } + RuntimeProto.CommonInvokeRequest.Builder requestBuilder = RuntimeProto.CommonInvokeRequest.newBuilder(); + requestBuilder.setMethod(method); + if (body != null) { + byte[] byteRequest = objectSerializer.serialize(body); + Any data = Any.newBuilder().setValue(ByteString.copyFrom(byteRequest)).build(); + requestBuilder.setData(data); + } else { + requestBuilder.setData(Any.newBuilder().build()); + } + RuntimeProto.HTTPExtension.Builder httpExtensionBuilder = RuntimeProto.HTTPExtension.newBuilder(); + + httpExtensionBuilder.setVerb(RuntimeProto.HTTPExtension.Verb.valueOf(httpExtension.getMethod().toString())) + .setQuerystring(httpExtension.encodeQueryString()); + requestBuilder.setHttpExtension(httpExtensionBuilder.build()); + + requestBuilder.setContentType(objectSerializer.getContentType()); + + RuntimeProto.InvokeServiceRequest.Builder envelopeBuilder = RuntimeProto.InvokeServiceRequest.newBuilder() + .setId(appId) + .setMessage(requestBuilder.build()); + return envelopeBuilder.build(); + } + + private State buildStateKeyValue( + RuntimeProto.BulkStateItem item, + TypeRef type) throws IOException { + String key = item.getKey(); + String error = item.getError(); + if (!Strings.isNullOrEmpty(error)) { + return new State<>(key, error); + } + + ByteString payload = item.getData(); + byte[] data = payload == null ? null : payload.toByteArray(); + T value = stateSerializer.deserialize(data, type); + String etag = item.getEtag(); + if (etag.equals("")) { + etag = null; + } + return new State<>(key, value, etag, item.getMetadataMap(), null); + } + + private State buildStateKeyValue( + RuntimeProto.GetStateResponse response, + String requestedKey, + StateOptions stateOptions, + TypeRef type) throws IOException { + ByteString payload = response.getData(); + byte[] data = payload == null ? null : payload.toByteArray(); + T value = stateSerializer.deserialize(data, type); + String etag = response.getEtag(); + if (etag.equals("")) { + etag = null; + } + return new State<>(requestedKey, value, etag, response.getMetadataMap(), stateOptions); + } + + private RuntimeProto.StateItem.Builder buildStateRequest(State state) throws IOException { + byte[] bytes = stateSerializer.serialize(state.getValue()); + + RuntimeProto.StateItem.Builder stateBuilder = RuntimeProto.StateItem.newBuilder(); + if (state.getEtag() != null) { + stateBuilder.setEtag(RuntimeProto.Etag.newBuilder().setValue(state.getEtag()).build()); + } + if (state.getMetadata() != null) { + stateBuilder.putAllMetadata(state.getMetadata()); + } + if (bytes != null) { + stateBuilder.setValue(ByteString.copyFrom(bytes)); + } + stateBuilder.setKey(state.getKey()); + RuntimeProto.StateOptions.Builder optionBuilder = null; + if (state.getOptions() != null) { + StateOptions options = state.getOptions(); + optionBuilder = RuntimeProto.StateOptions.newBuilder(); + if (options.getConcurrency() != null) { + optionBuilder.setConcurrency(getGrpcStateConcurrency(options)); + } + if (options.getConsistency() != null) { + optionBuilder.setConsistency(getGrpcStateConsistency(options)); + } + } + if (optionBuilder != null) { + stateBuilder.setOptions(optionBuilder.build()); + } + return stateBuilder; + } + + private RuntimeProto.StateOptions.StateConsistency getGrpcStateConsistency(StateOptions options) { + switch (options.getConsistency()) { + case EVENTUAL: + return RuntimeProto.StateOptions.StateConsistency.CONSISTENCY_EVENTUAL; + case STRONG: + return RuntimeProto.StateOptions.StateConsistency.CONSISTENCY_STRONG; + default: + throw new IllegalArgumentException("Missing Consistency mapping to gRPC Consistency enum"); + } + } + + private RuntimeProto.StateOptions.StateConcurrency getGrpcStateConcurrency(StateOptions options) { + switch (options.getConcurrency()) { + case FIRST_WRITE: + return RuntimeProto.StateOptions.StateConcurrency.CONCURRENCY_FIRST_WRITE; + case LAST_WRITE: + return RuntimeProto.StateOptions.StateConcurrency.CONCURRENCY_LAST_WRITE; + default: + throw new IllegalArgumentException("Missing StateConcurrency mapping to gRPC Concurrency enum"); + } + } + + // -- Lifecycle Functions + + @Override + public Mono waitForSidecar(int timeoutInMilliseconds) { + return Mono.fromRunnable(() -> { + try { + NetworkUtils.waitForSocket(Properties.SIDECAR_IP.get(), Properties.GRPC_PORT.get(), timeoutInMilliseconds); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + }); + } + + @Override + public Mono shutdown() { + return Mono.subscriberContext() + // FIXME: 2021/9/26 Refer to Dapr + // .flatMap(context -> + // this.createMono(it -> + // intercept(context, asyncStub) + // .shutdown(Empty.getDefaultInstance(), it))) + .then(); + } + + private Mono createMono(Consumer> consumer) { + return Mono.create(sink -> + LayottoException + .wrap(() -> consumer.accept(createStreamObserver(sink))) + .run()); + } + + private StreamObserver createStreamObserver(MonoSink sink) { + return new StreamObserver() { + @Override + public void onNext(T value) { + sink.success(value); + } + + @Override + public void onError(Throwable t) { + sink.error(LayottoException.propagate(new ExecutionException(t))); + } + + @Override + public void onCompleted() { + sink.success(); + } + }; + } + + /** + * Closes the ManagedChannel for GRPC. + * + * @throws IOException on exception. + * @see io.grpc.ManagedChannel#shutdown() + */ + @Override + public void close() throws Exception { + if (channel != null) { + LayottoException + .wrap(() -> { + channel.close(); + return true; + }) + .call(); + } + } + + /** + * Populates GRPC client with interceptors for telemetry. + * + * @param context Reactor's context. + * @param client GRPC client for Layotto. + * @return Client after adding interceptors. + */ + private static RuntimeGrpc.RuntimeStub intercept(Context context, RuntimeGrpc.RuntimeStub client) { + return GrpcWrapper.intercept(context, client); + } + + /** + * Populates GRPC client with interceptors. + * + * @param client GRPC client for Layotto. + * @return Client after adding interceptors. + */ + private static RuntimeGrpc.RuntimeStub intercept(RuntimeGrpc.RuntimeStub client) { + ClientInterceptor interceptor = new ClientInterceptor() { + @Override + public ClientCall interceptCall(MethodDescriptor methodDescriptor, + CallOptions callOptions, + Channel channel) { + ClientCall clientCall = channel.newCall(methodDescriptor, callOptions); + return new ForwardingClientCall.SimpleForwardingClientCall(clientCall) { + @Override + public void start(final Listener responseListener, final Metadata metadata) { + String layottoApiToken = Properties.API_TOKEN.get(); + if (layottoApiToken != null) { + metadata.put(Metadata.Key.of(Headers.DAPR_API_TOKEN, Metadata.ASCII_STRING_MARSHALLER), + layottoApiToken); + } + super.start(responseListener, metadata); + } + }; + } + }; + return client.withInterceptors(interceptor); + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/BooleanProperty.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/BooleanProperty.java new file mode 100644 index 0000000..d2211cd --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/BooleanProperty.java @@ -0,0 +1,36 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.config; + +/** + * Boolean configuration property. + */ +public class BooleanProperty extends Property { + + /** + * {@inheritDoc} + */ + BooleanProperty(String name, String envName, Boolean defaultValue) { + super(name, envName, defaultValue); + } + + /** + * {@inheritDoc} + */ + @Override + protected Boolean parse(String value) { + return Boolean.valueOf(value); + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/GenericProperty.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/GenericProperty.java new file mode 100644 index 0000000..3c060b0 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/GenericProperty.java @@ -0,0 +1,41 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.config; + +import java.util.function.Function; + +/** + * Configuration property for any type. + */ +public class GenericProperty extends Property { + + private final Function parser; + + /** + * {@inheritDoc} + */ + GenericProperty(String name, String envName, T defaultValue, Function parser) { + super(name, envName, defaultValue); + this.parser = parser; + } + + /** + * {@inheritDoc} + */ + @Override + protected T parse(String value) { + return parser.apply(value); + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/IntegerProperty.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/IntegerProperty.java new file mode 100644 index 0000000..8eb6e0b --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/IntegerProperty.java @@ -0,0 +1,36 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.config; + +/** + * Integer configuration property. + */ +public class IntegerProperty extends Property { + + /** + * {@inheritDoc} + */ + IntegerProperty(String name, String envName, Integer defaultValue) { + super(name, envName, defaultValue); + } + + /** + * {@inheritDoc} + */ + @Override + protected Integer parse(String value) { + return Integer.valueOf(value); + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/Properties.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/Properties.java new file mode 100644 index 0000000..78b0caa --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/Properties.java @@ -0,0 +1,89 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.config; + + +import io.mosn.layotto.v1.value.LayottoApiProtocol; + +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; + +/** + * Global properties for Layotto's SDK, using Supplier so they are dynamically resolved. + */ +public class Properties { + + /** + * Layotto's default IP for gRPC communication. + */ + private static final String DEFAULT_SIDECAR_IP = "127.0.0.1"; + + /** + * Layotto's default gRPC port. + */ + private static final Integer DEFAULT_GRPC_PORT = 34904; + + /** + * Layotto's default use of gRPC. + */ + private static final LayottoApiProtocol DEFAULT_API_PROTOCOL = LayottoApiProtocol.GRPC; + + /** + * Layotto's default String encoding: UTF-8. + */ + private static final Charset DEFAULT_STRING_CHARSET = StandardCharsets.UTF_8; + + /** + * IP for Layotto's sidecar. + */ + public static final Property SIDECAR_IP = new StringProperty( + "layotto.sidecar.ip", + "LAYOTTO_SIDECAR_IP", + DEFAULT_SIDECAR_IP); + + /** + * GRPC port for Layotto after checking system property and environment variable. + */ + public static final Property GRPC_PORT = new IntegerProperty( + "layotto.grpc.port", + "LAYOTTO_GRPC_PORT", + DEFAULT_GRPC_PORT); + + /** + * Determines if Layotto client will use gRPC to talk to Layotto's sidecar. + */ + public static final Property API_PROTOCOL = new GenericProperty<>( + "layotto.api.protocol", + "LAYOTTO_API_PROTOCOL", + DEFAULT_API_PROTOCOL, + (s) -> LayottoApiProtocol.valueOf(s.toUpperCase())); + + /** + * API token for authentication between App and Layotto's sidecar. + */ + public static final Property API_TOKEN = new StringProperty( + "layotto.api.token", + "LAYOTTO_API_TOKEN", + null); + + /** + * Determines which string encoding is used in Layotto's Java SDK. + */ + public static final Property STRING_CHARSET = new GenericProperty<>( + "layotto.string.charset", + "LAYOTTO_STRING_CHARSET", + DEFAULT_STRING_CHARSET, + (s) -> Charset.forName(s)); +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/Property.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/Property.java new file mode 100644 index 0000000..f9801e1 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/Property.java @@ -0,0 +1,109 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.config; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * A configuration property in the Layotto's SDK. + */ +public abstract class Property { + + private static final Logger LOGGER = LoggerFactory.getLogger(Property.class.getName()); + + /** + * Property's name as a Java Property. + */ + private final String name; + + /** + * Property's name as a environment variable. + */ + private final String envName; + + /** + * Default value. + */ + private final T defaultValue; + + /** + * Instantiates a new configuration property. + * + * @param name Java property name. + * @param envName Environment variable name. + * @param defaultValue Default value. + */ + Property(String name, String envName, T defaultValue) { + this.name = name; + this.envName = envName; + this.defaultValue = defaultValue; + } + + /** + * Gets the Java property's name. + * + * @return Name. + */ + public String getName() { + return this.name; + } + + /** + * Gets the environment variable's name. + * + * @return Name. + */ + public String getEnvName() { + return this.envName; + } + + /** + * Gets the value defined by system property first, then env variable or sticks to default. + * + * @return Value from system property (1st) or env variable (2nd) or default (last). + */ + public T get() { + String propValue = System.getProperty(this.name); + if (propValue != null && !propValue.trim().isEmpty()) { + try { + return this.parse(propValue); + } catch (IllegalArgumentException e) { + LOGGER.warn(String.format("Invalid value in property: %s", this.name)); + // OK, we tried. Falling back to system environment variable. + } + } + + String envValue = System.getenv(this.envName); + if (envValue != null && !envValue.trim().isEmpty()) { + try { + return this.parse(envValue); + } catch (IllegalArgumentException e) { + LOGGER.warn(String.format("Invalid value in environment variable: %s", this.envName)); + // OK, we tried. Falling back to default. + } + } + + return this.defaultValue; + } + + /** + * Parses the value to the specific type. + * + * @param value String value to be parsed. + * @return Value in the specific type. + */ + protected abstract T parse(String value); +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/StringProperty.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/StringProperty.java new file mode 100644 index 0000000..34939aa --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/config/StringProperty.java @@ -0,0 +1,36 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.config; + +/** + * String configuration property. + */ +public class StringProperty extends Property { + + /** + * {@inheritDoc} + */ + StringProperty(String name, String envName, String defaultValue) { + super(name, envName, defaultValue); + } + + /** + * {@inheritDoc} + */ + @Override + protected String parse(String value) { + return value; + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/domain/CloudEvent.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/domain/CloudEvent.java new file mode 100644 index 0000000..312c36d --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/domain/CloudEvent.java @@ -0,0 +1,306 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.domain; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.util.Arrays; +import java.util.Objects; + +/** + * A cloud event in Layotto. + * + * @param The type of the payload. + */ +public final class CloudEvent { + + /** + * Mime type used for CloudEvent. + */ + public static final String CONTENT_TYPE = "application/cloudevents+json"; + + /** + * Shared Json serializer/deserializer as per Jackson's documentation. + */ + protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, + false) + .setSerializationInclusion(JsonInclude.Include.NON_NULL); + + /** + * Identifier of the message being processed. + */ + private String id; + + /** + * Event's source. + */ + private String source; + + /** + * Envelope type. + */ + private String type; + + /** + * Version of the specification. + */ + private String specversion; + + /** + * Type of the data's content. + */ + private String datacontenttype; + + /** + * Cloud event specs says data can be a JSON object or string. + */ + private T data; + + /** + * Cloud event specs says binary data should be in data_base64. + */ + @JsonProperty("data_base64") + private byte[] binaryData; + + /** + * Instantiates a CloudEvent. + */ + public CloudEvent() { + } + + /** + * Instantiates a CloudEvent. + * + * @param id Identifier of the message being processed. + * @param source Source for this event. + * @param type Type of event. + * @param specversion Version of the event spec. + * @param datacontenttype Type of the payload. + * @param data Payload. + */ + public CloudEvent( + String id, + String source, + String type, + String specversion, + String datacontenttype, + T data) { + this.id = id; + this.source = source; + this.type = type; + this.specversion = specversion; + this.datacontenttype = datacontenttype; + this.data = data; + } + + /** + * Instantiates a CloudEvent. + * + * @param id Identifier of the message being processed. + * @param source Source for this event. + * @param type Type of event. + * @param specversion Version of the event spec. + * @param binaryData Payload. + */ + public CloudEvent( + String id, + String source, + String type, + String specversion, + byte[] binaryData) { + this.id = id; + this.source = source; + this.type = type; + this.specversion = specversion; + this.datacontenttype = "application/octet-stream"; + this.binaryData = binaryData == null ? null : Arrays.copyOf(binaryData, binaryData.length); + ; + } + + /** + * Deserialize a message topic from Layotto. + * + * @param payload Payload sent from Layotto. + * @return Message (can be null if input is null) + * @throws IOException If cannot parse. + */ + public static CloudEvent deserialize(byte[] payload) throws IOException { + if (payload == null) { + return null; + } + + return OBJECT_MAPPER.readValue(payload, CloudEvent.class); + } + + /** + * Gets the identifier of the message being processed. + * + * @return Identifier of the message being processed. + */ + public String getId() { + return id; + } + + /** + * Sets the identifier of the message being processed. + * + * @param id Identifier of the message being processed. + */ + public void setId(String id) { + this.id = id; + } + + /** + * Gets the event's source. + * + * @return Event's source. + */ + public String getSource() { + return source; + } + + /** + * Sets the event's source. + * + * @param source Event's source. + */ + public void setSource(String source) { + this.source = source; + } + + /** + * Gets the envelope type. + * + * @return Envelope type. + */ + public String getType() { + return type; + } + + /** + * Sets the envelope type. + * + * @param type Envelope type. + */ + public void setType(String type) { + this.type = type; + } + + /** + * Gets the version of the specification. + * + * @return Version of the specification. + */ + public String getSpecversion() { + return specversion; + } + + /** + * Sets the version of the specification. + * + * @param specversion Version of the specification. + */ + public void setSpecversion(String specversion) { + this.specversion = specversion; + } + + /** + * Gets the type of the data's content. + * + * @return Type of the data's content. + */ + public String getDatacontenttype() { + return datacontenttype; + } + + /** + * Sets the type of the data's content. + * + * @param datacontenttype Type of the data's content. + */ + public void setDatacontenttype(String datacontenttype) { + this.datacontenttype = datacontenttype; + } + + /** + * Gets the cloud event data. + * + * @return Cloud event's data. As per specs, data can be a JSON object or string. + */ + public T getData() { + return data; + } + + /** + * Sets the cloud event data. As per specs, data can be a JSON object or string. + * + * @param data Cloud event's data. As per specs, data can be a JSON object or string. + */ + public void setData(T data) { + this.data = data; + } + + /** + * Gets the cloud event's binary data. + * + * @return Cloud event's binary data. + */ + public byte[] getBinaryData() { + return this.binaryData == null ? null : Arrays.copyOf(this.binaryData, this.binaryData.length); + } + + /** + * Sets the cloud event's binary data. + * + * @param binaryData Cloud event's binary data. + */ + public void setBinaryData(byte[] binaryData) { + this.binaryData = binaryData == null ? null : Arrays.copyOf(binaryData, binaryData.length); + } + + /** + * {@inheritDoc} + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CloudEvent that = (CloudEvent) o; + return Objects.equals(id, that.id) + && Objects.equals(source, that.source) + && Objects.equals(type, that.type) + && Objects.equals(specversion, that.specversion) + && Objects.equals(datacontenttype, that.datacontenttype) + && Objects.equals(data, that.data) + && Arrays.equals(binaryData, that.binaryData); + } + + /** + * {@inheritDoc} + */ + @Override + public int hashCode() { + return Objects.hash(id, source, type, specversion, datacontenttype, data, binaryData); + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/exceptions/LayottoError.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/exceptions/LayottoError.java new file mode 100644 index 0000000..c7ddaa0 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/exceptions/LayottoError.java @@ -0,0 +1,83 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.exceptions; + +import com.fasterxml.jackson.annotation.JsonAutoDetect; +import io.grpc.Status; + +/** + * Represents an error message from Layotto. + */ +@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) +public class LayottoError { + + /** + * Error code. + */ + private String errorCode; + + /** + * Error Message. + */ + private String message; + + /** + * Error code from gRPC. + */ + private Integer code; + + /** + * Gets the error code. + * + * @return Error code. + */ + public String getErrorCode() { + if ((errorCode == null) && (code != null)) { + return Status.fromCodeValue(code).getCode().name(); + } + return errorCode; + } + + /** + * Sets the error code. + * + * @param errorCode Error code. + * @return This instance. + */ + public LayottoError setErrorCode(String errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Gets the error message. + * + * @return Error message. + */ + public String getMessage() { + return message; + } + + /** + * Sets the error message. + * + * @param message Error message. + * @return This instance. + */ + public LayottoError setMessage(String message) { + this.message = message; + return this; + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/exceptions/LayottoException.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/exceptions/LayottoException.java new file mode 100644 index 0000000..dedadef --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/exceptions/LayottoException.java @@ -0,0 +1,203 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.exceptions; + +import io.grpc.StatusRuntimeException; +import reactor.core.Exceptions; +import reactor.core.publisher.Mono; + +import java.util.concurrent.Callable; + +/** + * A Layotto's specific exception. + */ +public class LayottoException extends RuntimeException { + + /** + * Layotto's error code for this exception. + */ + private final String errorCode; + + /** + * New exception from a server-side generated error code and message. + * + * @param daprError Server-side error. + */ + public LayottoException(LayottoError daprError) { + this(daprError.getErrorCode(), daprError.getMessage()); + } + + /** + * New exception from a server-side generated error code and message. + * + * @param daprError Client-side error. + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A {@code null} value is + * permitted, and indicates that the cause is nonexistent or + * unknown.) + */ + public LayottoException(LayottoError daprError, Throwable cause) { + this(daprError.getErrorCode(), daprError.getMessage(), cause); + } + + /** + * Wraps an exception into a LayottoException. + * + * @param exception the exception to be wrapped. + */ + public LayottoException(Throwable exception) { + this("UNKNOWN", exception.getMessage(), exception); + } + + /** + * New Exception from a client-side generated error code and message. + * + * @param errorCode Client-side error code. + * @param message Client-side error message. + */ + public LayottoException(String errorCode, String message) { + super(String.format("%s: %s", errorCode, message)); + this.errorCode = errorCode; + } + + /** + * New exception from a server-side generated error code and message. + * + * @param errorCode Client-side error code. + * @param message Client-side error message. + * @param cause the cause (which is saved for later retrieval by the + * {@link #getCause()} method). (A {@code null} value is + * permitted, and indicates that the cause is nonexistent or + * unknown.) + */ + public LayottoException(String errorCode, String message, Throwable cause) { + super(String.format("%s: %s", errorCode, emptyIfNull(message)), cause); + this.errorCode = errorCode; + } + + /** + * Returns the exception's error code. + * + * @return Error code. + */ + public String getErrorCode() { + return this.errorCode; + } + + /** + * Wraps an exception into LayottoException (if not already LayottoException). + * + * @param exception Exception to be wrapped. + */ + public static void wrap(Throwable exception) { + if (exception == null) { + return; + } + + throw propagate(exception); + } + + /** + * Wraps a callable with a try-catch to throw LayottoException. + * + * @param callable callable to be invoked. + * @param type to be returned + * @return object of type T. + */ + public static Callable wrap(Callable callable) { + return () -> { + try { + return callable.call(); + } catch (Exception e) { + wrap(e); + return null; + } + }; + } + + /** + * Wraps a runnable with a try-catch to throw LayottoException. + * + * @param runnable runnable to be invoked. + * @return object of type T. + */ + public static Runnable wrap(Runnable runnable) { + return () -> { + try { + runnable.run(); + } catch (Exception e) { + wrap(e); + } + }; + } + + /** + * Wraps an exception into LayottoException (if not already LayottoException). + * + * @param exception Exception to be wrapped. + * @param Mono's response type. + * @return Mono containing LayottoException. + */ + public static Mono wrapMono(Exception exception) { + try { + wrap(exception); + } catch (Exception e) { + return Mono.error(e); + } + + return Mono.empty(); + } + + /** + * Wraps an exception into LayottoException (if not already LayottoException). + * + * @param exception Exception to be wrapped. + * @return wrapped RuntimeException + */ + public static RuntimeException propagate(Throwable exception) { + Exceptions.throwIfFatal(exception); + + if (exception instanceof LayottoException) { + return (LayottoException) exception; + } + + Throwable e = exception; + while (e != null) { + if (e instanceof StatusRuntimeException) { + StatusRuntimeException statusRuntimeException = (StatusRuntimeException) e; + return new LayottoException( + statusRuntimeException.getStatus().getCode().toString(), + statusRuntimeException.getStatus().getDescription(), + exception); + } + + e = e.getCause(); + } + + if (exception instanceof IllegalArgumentException) { + return (IllegalArgumentException) exception; + } + + return new LayottoException(exception); + } + + private static String emptyIfNull(String str) { + if (str == null) { + return ""; + } + + return str; + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/serializer/DefaultObjectSerializer.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/serializer/DefaultObjectSerializer.java new file mode 100644 index 0000000..e049d96 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/serializer/DefaultObjectSerializer.java @@ -0,0 +1,49 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.serializer; + +import spec.sdk.reactor.v1.utils.TypeRef; + +import java.io.IOException; + +/** + * Default serializer/deserializer for request/response objects and for state objects too. + */ +public class DefaultObjectSerializer extends ObjectSerializer implements LayottoObjectSerializer { + + /** + * {@inheritDoc} + */ + @Override + public byte[] serialize(Object o) throws IOException { + return super.serialize(o); + } + + /** + * {@inheritDoc} + */ + @Override + public T deserialize(byte[] data, TypeRef type) throws IOException { + return super.deserialize(data, type); + } + + /** + * {@inheritDoc} + */ + @Override + public String getContentType() { + return "application/json"; + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/serializer/LayottoObjectSerializer.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/serializer/LayottoObjectSerializer.java new file mode 100644 index 0000000..6d74a63 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/serializer/LayottoObjectSerializer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.serializer; + +import spec.sdk.reactor.v1.utils.TypeRef; + +import java.io.IOException; + +/** + * Serializes and deserializes application's objects. + */ +public interface LayottoObjectSerializer { + + /** + * Serializes the given object as byte[]. + * + * @param o Object to be serialized. + * @return Serialized object. + * @throws IOException If cannot serialize. + */ + byte[] serialize(Object o) throws IOException; + + /** + * Deserializes the given byte[] into a object. + * + * @param data Data to be deserialized. + * @param type Type of object to be deserialized. + * @param Type of object to be deserialized. + * @return Deserialized object. + * @throws IOException If cannot deserialize object. + */ + T deserialize(byte[] data, TypeRef type) throws IOException; + + /** + * Returns the content type of the request. + * + * @return content type of the request + */ + String getContentType(); +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/serializer/ObjectSerializer.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/serializer/ObjectSerializer.java new file mode 100644 index 0000000..f09ace3 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/serializer/ObjectSerializer.java @@ -0,0 +1,205 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.serializer; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.protobuf.MessageLite; +import io.mosn.layotto.v1.domain.CloudEvent; +import spec.sdk.reactor.v1.utils.TypeRef; + +import java.io.IOException; +import java.lang.reflect.Method; + +/** + * Serializes and deserializes an internal object. + */ +public class ObjectSerializer { + + /** + * Shared Json serializer/deserializer as per Jackson's documentation. + */ + protected static final ObjectMapper OBJECT_MAPPER = new ObjectMapper() + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, + false) + .setSerializationInclusion(JsonInclude.Include.NON_NULL); + + /** + * Default constructor to avoid class from being instantiated outside package but still inherited. + */ + protected ObjectSerializer() { + } + + /** + * Serializes a given state object into byte array. + * + * @param state State object to be serialized. + * @return Array of bytes[] with the serialized content. + * @throws IOException In case state cannot be serialized. + */ + public byte[] serialize(Object state) throws IOException { + if (state == null) { + return null; + } + + if (state.getClass() == Void.class) { + return null; + } + + // Have this check here to be consistent with deserialization (see deserialize() method below). + if (state instanceof byte[]) { + return (byte[]) state; + } + + // Proto buffer class is serialized directly. + if (state instanceof MessageLite) { + return ((MessageLite) state).toByteArray(); + } + + // Not string, not primitive, so it is a complex type: we use JSON for that. + return OBJECT_MAPPER.writeValueAsBytes(state); + } + + /** + * Deserializes the byte array into the original object. + * + * @param content Content to be parsed. + * @param type Type of the object being deserialized. + * @param Generic type of the object being deserialized. + * @return Object of type T. + * @throws IOException In case content cannot be deserialized. + */ + public T deserialize(byte[] content, TypeRef type) throws IOException { + return deserialize(content, OBJECT_MAPPER.constructType(type.getType())); + } + + /** + * Deserializes the byte array into the original object. + * + * @param content Content to be parsed. + * @param clazz Type of the object being deserialized. + * @param Generic type of the object being deserialized. + * @return Object of type T. + * @throws IOException In case content cannot be deserialized. + */ + public T deserialize(byte[] content, Class clazz) throws IOException { + return deserialize(content, OBJECT_MAPPER.constructType(clazz)); + } + + private T deserialize(byte[] content, JavaType javaType) throws IOException { + if ((javaType == null) || javaType.isTypeOrSubTypeOf(Void.class)) { + return null; + } + + if (javaType.isPrimitive()) { + return deserializePrimitives(content, javaType); + } + + if (content == null) { + return null; + } + + // Deserialization of GRPC response fails without this check since it does not come as base64 encoded byte[]. + if (javaType.hasRawClass(byte[].class)) { + return (T) content; + } + + if (content.length == 0) { + return null; + } + + if (javaType.hasRawClass(CloudEvent.class)) { + return (T) CloudEvent.deserialize(content); + } + + if (javaType.isTypeOrSubTypeOf(MessageLite.class)) { + try { + Method method = javaType.getRawClass().getDeclaredMethod("parseFrom", byte[].class); + if (method != null) { + return (T) method.invoke(null, content); + } + } catch (NoSuchMethodException e) { + // It was a best effort. Skip this try. + } catch (Exception e) { + throw new IOException(e); + } + } + + return OBJECT_MAPPER.readValue(content, javaType); + } + + /** + * Parses the JSON content into a node for fine-grained processing. + * + * @param content JSON content. + * @return JsonNode. + * @throws IOException In case content cannot be parsed. + */ + public JsonNode parseNode(byte[] content) throws IOException { + return OBJECT_MAPPER.readTree(content); + } + + /** + * Parses a given String to the corresponding object defined by class. + * + * @param content Value to be parsed. + * @param javaType Type of the expected result type. + * @param Result type. + * @return Result as corresponding type. + * @throws IOException if cannot deserialize primitive time. + */ + private static T deserializePrimitives(byte[] content, JavaType javaType) throws IOException { + if ((content == null) || (content.length == 0)) { + if (javaType.hasRawClass(boolean.class)) { + return (T) Boolean.FALSE; + } + + if (javaType.hasRawClass(byte.class)) { + return (T) Byte.valueOf((byte) 0); + } + + if (javaType.hasRawClass(short.class)) { + return (T) Short.valueOf((short) 0); + } + + if (javaType.hasRawClass(int.class)) { + return (T) Integer.valueOf(0); + } + + if (javaType.hasRawClass(long.class)) { + return (T) Long.valueOf(0L); + } + + if (javaType.hasRawClass(float.class)) { + return (T) Float.valueOf(0); + } + + if (javaType.hasRawClass(double.class)) { + return (T) Double.valueOf(0); + } + + if (javaType.hasRawClass(char.class)) { + return (T) Character.valueOf(Character.MIN_VALUE); + } + + return null; + } + + return OBJECT_MAPPER.readValue(content, javaType); + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/utils/GrpcWrapper.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/utils/GrpcWrapper.java new file mode 100644 index 0000000..ab40749 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/utils/GrpcWrapper.java @@ -0,0 +1,77 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.utils; + +import io.grpc.CallOptions; +import io.grpc.Channel; +import io.grpc.ClientCall; +import io.grpc.ClientInterceptor; +import io.grpc.ForwardingClientCall; +import io.grpc.Metadata; +import io.grpc.MethodDescriptor; +import io.mosn.layotto.v1.config.Property; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import reactor.util.context.Context; +import spec.proto.runtime.v1.RuntimeGrpc; + +/** + * Wraps a Layotto gRPC stub with telemetry interceptor. + */ +public final class GrpcWrapper { + + private static final Logger LOGGER = LoggerFactory.getLogger(Property.class.getName()); + + private static final Metadata.Key GRPC_TRACE_BIN_KEY = + Metadata.Key.of("grpc-trace-bin", + Metadata.BINARY_BYTE_MARSHALLER); + + private static final Metadata.Key TRACEPARENT_KEY = + Metadata.Key.of("traceparent", + Metadata.ASCII_STRING_MARSHALLER); + + private static final Metadata.Key TRACESTATE_KEY = + Metadata.Key.of("tracestate", + Metadata.ASCII_STRING_MARSHALLER); + + private GrpcWrapper() { + } + + /** + * Populates GRPC client with interceptors. + * + * @param context Reactor's context. + * @param client GRPC client for Layotto. + * @return Client after adding interceptors. + */ + public static RuntimeGrpc.RuntimeStub intercept(final Context context, RuntimeGrpc.RuntimeStub client) { + ClientInterceptor interceptor = new ClientInterceptor() { + @Override + public ClientCall interceptCall(MethodDescriptor methodDescriptor, + CallOptions callOptions, + Channel channel) { + ClientCall clientCall = channel.newCall(methodDescriptor, callOptions); + return new ForwardingClientCall.SimpleForwardingClientCall(clientCall) { + @Override + public void start(final Listener responseListener, final Metadata metadata) { + // FIXME: 2021/9/26 Refer to Dapr + super.start(responseListener, metadata); + } + }; + } + }; + return client.withInterceptors(interceptor); + } +} \ No newline at end of file diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/utils/NetworkUtils.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/utils/NetworkUtils.java new file mode 100644 index 0000000..4faa324 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/utils/NetworkUtils.java @@ -0,0 +1,87 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.utils; + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.Socket; + +/** + * Utility methods for network, internal to Dapr SDK. + */ +public final class NetworkUtils { + + private NetworkUtils() { + } + + /** + * Tries to connect to a socket, retrying every 1 second. + * + * @param host Host to connect to. + * @param port Port to connect to. + * @param timeoutInMilliseconds Timeout in milliseconds to give up trying. + * @throws InterruptedException If retry is interrupted. + */ + public static void waitForSocket(String host, int port, int timeoutInMilliseconds) throws InterruptedException { + long started = System.currentTimeMillis(); + Retry.callWithRetry(() -> { + try { + try (Socket socket = new Socket()) { + // timeout cannot be negative. + // zero timeout means infinite, so 1 is the practical minimum. + int remainingTimeout = (int) Math.max(1, timeoutInMilliseconds - (System.currentTimeMillis() - started)); + socket.connect(new InetSocketAddress(host, port), remainingTimeout); + } + } catch (IOException e) { + throw new RuntimeException(e); + } + }, timeoutInMilliseconds); + } +} + +class Retry { + + private static final long RETRY_WAIT_MILLISECONDS = 1000; + + private Retry() { + } + + static void callWithRetry(Runnable function, long retryTimeoutMilliseconds) throws InterruptedException { + long started = System.currentTimeMillis(); + while (true) { + Throwable exception; + try { + function.run(); + return; + } catch (Exception e) { + exception = e; + } catch (AssertionError e) { + exception = e; + } + + long elapsed = System.currentTimeMillis() - started; + if (elapsed >= retryTimeoutMilliseconds) { + if (exception instanceof RuntimeException) { + throw (RuntimeException) exception; + } + + throw new RuntimeException(exception); + } + + long remaining = retryTimeoutMilliseconds - elapsed; + Thread.sleep(Math.min(remaining, RETRY_WAIT_MILLISECONDS)); + } + } +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/value/Headers.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/value/Headers.java new file mode 100644 index 0000000..c8b9cde --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/value/Headers.java @@ -0,0 +1,31 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.value; + +/** + * Common headers for GRPC and HTTP communication. + */ +public class Headers { + + /** + * OpenCensus's metadata for GRPC. + */ + public static final String GRPC_TRACE_BIN = "grpc-trace-bin"; + + /** + * Token for authentication from Application to Layotto runtime. + */ + public static final String DAPR_API_TOKEN = "layotto-api-token"; +} diff --git a/sdk-reactor/src/main/java/io/mosn/layotto/v1/value/LayottoApiProtocol.java b/sdk-reactor/src/main/java/io/mosn/layotto/v1/value/LayottoApiProtocol.java new file mode 100644 index 0000000..223b264 --- /dev/null +++ b/sdk-reactor/src/main/java/io/mosn/layotto/v1/value/LayottoApiProtocol.java @@ -0,0 +1,23 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.value; + +/** + * Transport protocol for Layotto's API. + */ +public enum LayottoApiProtocol { + + GRPC; +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/CoreCloudRuntimes.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/CoreCloudRuntimes.java new file mode 100644 index 0000000..b4e2266 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/CoreCloudRuntimes.java @@ -0,0 +1,32 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1; + +import spec.sdk.reactor.v1.domain.core.ConfigurationRuntimes; +import spec.sdk.reactor.v1.domain.core.InvocationRuntimes; +import spec.sdk.reactor.v1.domain.core.PubSubRuntimes; +import spec.sdk.reactor.v1.domain.core.StateRuntimes; + +/** + * Core Cloud Runtimes standard API defined. + */ +public interface CoreCloudRuntimes extends + InvocationRuntimes, + PubSubRuntimes, + // BindingRuntimes, + StateRuntimes, + // SecretsRuntimes, + ConfigurationRuntimes { +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/EnhancedCloudRuntimes.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/EnhancedCloudRuntimes.java new file mode 100644 index 0000000..63f243b --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/EnhancedCloudRuntimes.java @@ -0,0 +1,24 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1; + +import spec.sdk.reactor.v1.domain.enhanced.MetricsRuntimes; + +/** + * Enhanced Cloud Runtimes standard API defined. + */ +public interface EnhancedCloudRuntimes extends + MetricsRuntimes { +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/README.md b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/README.md new file mode 100644 index 0000000..70996cf --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/README.md @@ -0,0 +1 @@ +This package was copied from [cloud-runtimes-jvm](https://github.com/reactivegroup/cloud-runtimes-jvm) and [Dapr java sdk](https://github.com/dapr/java-sdk) \ No newline at end of file diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/client/CloudRuntimesClient.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/client/CloudRuntimesClient.java new file mode 100644 index 0000000..60b19c9 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/client/CloudRuntimesClient.java @@ -0,0 +1,40 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.client; + +import reactor.core.publisher.Mono; +import spec.sdk.reactor.v1.CoreCloudRuntimes; +import spec.sdk.reactor.v1.EnhancedCloudRuntimes; + +/** + * Cloud Runtimes JVM Client. + */ +public interface CloudRuntimesClient extends AutoCloseable, CoreCloudRuntimes, EnhancedCloudRuntimes { + + /** + * Waits for the sidecar, giving up after timeout. + * + * @param timeoutInMilliseconds Timeout in milliseconds to wait for sidecar. + * @return a Mono plan of type Void. + */ + Mono waitForSidecar(int timeoutInMilliseconds); + + /** + * Gracefully shutdown the cloud-runtimes runtime. + * + * @return a Mono plan of type Void. + */ + Mono shutdown(); +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/ConfigurationRuntimes.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/ConfigurationRuntimes.java new file mode 100644 index 0000000..2a726fb --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/ConfigurationRuntimes.java @@ -0,0 +1,69 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core; + +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; +import spec.sdk.reactor.v1.domain.core.configuration.ConfigurationItem; +import spec.sdk.reactor.v1.domain.core.configuration.ConfigurationRequestItem; +import spec.sdk.reactor.v1.domain.core.configuration.SaveConfigurationRequest; +import spec.sdk.reactor.v1.domain.core.configuration.SubConfigurationResp; +import spec.sdk.reactor.v1.utils.TypeRef; + +import java.util.List; + +/** + * Configuration Runtimes standard API defined. + */ +public interface ConfigurationRuntimes { + + /** + * Gets configuration from configuration store + * + * @param The Type of the return. + * @param configurationRequestItem Request object. + * @param type The Type needed as return for the call. + * @return A Mono Plan of response with type T. + */ + Mono>> getConfiguration(ConfigurationRequestItem configurationRequestItem, + TypeRef type); + + /** + * Saves configuration into configuration store. + * + * @param saveConfigurationRequest Request object. + * @return A Mono Plan of invocation. + */ + Mono saveConfiguration(SaveConfigurationRequest saveConfigurationRequest); + + /** + * Deletes configuration from configuration store. + * + * @param configurationRequestItem Request object. + * @return A Mono Plan of invocation. + */ + Mono deleteConfiguration(ConfigurationRequestItem configurationRequestItem); + + /** + * Gets configuration from configuration store and subscribe the updates. + * + * @param The Type of the return. + * @param configurationRequestItem Request object. + * @param type The Type needed as return for the call. + * @return A Flux Plan of response with type T. Subscribe update listener. + */ + Flux> subscribeConfiguration(ConfigurationRequestItem configurationRequestItem, + TypeRef type); +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/InvocationRuntimes.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/InvocationRuntimes.java new file mode 100644 index 0000000..7d9f20b --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/InvocationRuntimes.java @@ -0,0 +1,184 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core; + +import reactor.core.publisher.Mono; +import spec.sdk.reactor.v1.domain.core.invocation.HttpExtension; +import spec.sdk.reactor.v1.domain.core.invocation.InvokeMethodRequest; +import spec.sdk.reactor.v1.utils.TypeRef; + +import java.util.Map; + +/** + * Service-to-Service Invocation Runtimes standard API defined. + */ +public interface InvocationRuntimes { + + /** + * Invoke a service method, using serialization. + * + * @param appId The Application ID where the service is. + * @param methodName The actual Method to be call in the application. + * @param data The data to be sent to invoke the service, use byte[] to skip serialization. + * @param httpExtension Additional fields that are needed if the receiving app is listening on + * HTTP, {@link HttpExtension#NONE} otherwise. + * @param metadata Metadata (in GRPC) or headers (in HTTP) to be sent in data. + * @param type The Type needed as return for the call. + * @param The Type of the return, use byte[] to skip serialization. + * @return A Mono Plan of type T. + */ + Mono invokeMethod(String appId, String methodName, Object data, HttpExtension httpExtension, + Map metadata, TypeRef type); + + /** + * Invoke a service method, using serialization. + * + * @param appId The Application ID where the service is. + * @param methodName The actual Method to be call in the application. + * @param request The request to be sent to invoke the service, use byte[] to skip serialization. + * @param httpExtension Additional fields that are needed if the receiving app is listening on + * HTTP, {@link HttpExtension#NONE} otherwise. + * @param metadata Metadata (in GRPC) or headers (in HTTP) to be sent in request. + * @param clazz The type needed as return for the call. + * @param The Type of the return, use byte[] to skip serialization. + * @return A Mono Plan of type T. + */ + Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + Map metadata, Class clazz); + + /** + * Invoke a service method, using serialization. + * + * @param appId The Application ID where the service is. + * @param methodName The actual Method to be call in the application. + * @param request The request to be sent to invoke the service, use byte[] to skip serialization. + * @param httpExtension Additional fields that are needed if the receiving app is listening on + * HTTP, {@link HttpExtension#NONE} otherwise. + * @param type The Type needed as return for the call. + * @param The Type of the return, use byte[] to skip serialization. + * @return A Mono Plan of type T. + */ + Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + TypeRef type); + + /** + * Invoke a service method, using serialization. + * + * @param appId The Application ID where the service is. + * @param methodName The actual Method to be call in the application. + * @param request The request to be sent to invoke the service, use byte[] to skip serialization. + * @param httpExtension Additional fields that are needed if the receiving app is listening on + * HTTP, {@link HttpExtension#NONE} otherwise. + * @param clazz The type needed as return for the call. + * @param The Type of the return, use byte[] to skip serialization. + * @return A Mono Plan of type T. + */ + Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + Class clazz); + + /** + * Invoke a service method, using serialization. + * + * @param appId The Application ID where the service is. + * @param methodName The actual Method to be call in the application. + * @param httpExtension Additional fields that are needed if the receiving app is listening on + * HTTP, {@link HttpExtension#NONE} otherwise. + * @param metadata Metadata (in GRPC) or headers (in HTTP) to be sent in request. + * @param type The Type needed as return for the call. + * @param The Type of the return, use byte[] to skip serialization. + * @return A Mono Plan of type T. + */ + Mono invokeMethod(String appId, String methodName, HttpExtension httpExtension, + Map metadata, + TypeRef type); + + /** + * Invoke a service method, using serialization. + * + * @param appId The Application ID where the service is. + * @param methodName The actual Method to be call in the application. + * @param httpExtension Additional fields that are needed if the receiving app is listening on + * HTTP, {@link HttpExtension#NONE} otherwise. + * @param metadata Metadata (in GRPC) or headers (in HTTP) to be sent in request. + * @param clazz The type needed as return for the call. + * @param The Type of the return, use byte[] to skip serialization. + * @return A Mono Plan of type T. + */ + Mono invokeMethod(String appId, String methodName, HttpExtension httpExtension, + Map metadata, + Class clazz); + + /** + * Invoke a service method, using serialization. + * + * @param appId The Application ID where the service is. + * @param methodName The actual Method to be call in the application. + * @param request The request to be sent to invoke the service, use byte[] to skip serialization. + * @param httpExtension Additional fields that are needed if the receiving app is listening on + * HTTP, {@link HttpExtension#NONE} otherwise. + * @param metadata Metadata (in GRPC) or headers (in HTTP) to be sent in request. + * @return A Mono Plan of type Void. + */ + Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension, + Map metadata); + + /** + * Invoke a service method, using serialization. + * + * @param appId The Application ID where the service is. + * @param methodName The actual Method to be call in the application. + * @param request The request to be sent to invoke the service, use byte[] to skip serialization. + * @param httpExtension Additional fields that are needed if the receiving app is listening on + * HTTP, {@link HttpExtension#NONE} otherwise. + * @return A Mono Plan of type Void. + */ + Mono invokeMethod(String appId, String methodName, Object request, HttpExtension httpExtension); + + /** + * Invoke a service method, using serialization. + * + * @param appId The Application ID where the service is. + * @param methodName The actual Method to be call in the application. + * @param httpExtension Additional fields that are needed if the receiving app is listening on + * HTTP, {@link HttpExtension#NONE} otherwise. + * @param metadata Metadata (in GRPC) or headers (in HTTP) to be sent in request. + * @return A Mono Plan of type Void. + */ + Mono invokeMethod(String appId, String methodName, HttpExtension httpExtension, Map metadata); + + /** + * Invoke a service method, without using serialization. + * + * @param appId The Application ID where the service is. + * @param methodName The actual Method to be call in the application. + * @param request The request to be sent to invoke the service, use byte[] to skip serialization. + * @param httpExtension Additional fields that are needed if the receiving app is listening on + * HTTP, {@link HttpExtension#NONE} otherwise. + * @param metadata Metadata (in GRPC) or headers (in HTTP) to be sent in request. + * @return A Mono Plan of type byte[]. + */ + Mono invokeMethod(String appId, String methodName, byte[] request, HttpExtension httpExtension, + Map metadata); + + /** + * Invoke a service method. + * + * @param invokeMethodRequest Request object. + * @param type The Type needed as return for the call. + * @param The Type of the return, use byte[] to skip serialization. + * @return A Mono Plan of type T. + */ + Mono invokeMethod(InvokeMethodRequest invokeMethodRequest, TypeRef type); +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/PubSubRuntimes.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/PubSubRuntimes.java new file mode 100644 index 0000000..c09b6b1 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/PubSubRuntimes.java @@ -0,0 +1,55 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core; + +import reactor.core.publisher.Mono; +import spec.sdk.reactor.v1.domain.core.pubsub.PublishEventRequest; + +import java.util.Map; + +/** + * Publish and Subscribe Runtimes standard API defined. + */ +public interface PubSubRuntimes { + + /** + * Publish an event. + * + * @param pubsubName the pubsub name we will publish the event to + * @param topicName the topicName where the event will be published. + * @param data the event's data to be published, use byte[] for skipping serialization. + * @return a Mono plan of type Void. + */ + Mono publishEvent(String pubsubName, String topicName, Object data); + + /** + * Publish an event. + * + * @param pubsubName the pubsub name we will publish the event to + * @param topicName the topicName where the event will be published. + * @param data the event's data to be published, use byte[] for skipping serialization. + * @param metadata The metadata for the published event. + * @return a Mono plan of type Void. + */ + Mono publishEvent(String pubsubName, String topicName, Object data, Map metadata); + + /** + * Publish an event. + * + * @param request the request for the publish event. + * @return a Mono plan of a CloudRuntimes's void response. + */ + Mono publishEvent(PublishEventRequest request); +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/StateRuntimes.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/StateRuntimes.java new file mode 100644 index 0000000..465de5f --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/StateRuntimes.java @@ -0,0 +1,229 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core; + +import reactor.core.publisher.Mono; +import spec.sdk.reactor.v1.domain.core.state.DeleteStateRequest; +import spec.sdk.reactor.v1.domain.core.state.ExecuteStateTransactionRequest; +import spec.sdk.reactor.v1.domain.core.state.GetBulkStateRequest; +import spec.sdk.reactor.v1.domain.core.state.GetStateRequest; +import spec.sdk.reactor.v1.domain.core.state.SaveStateRequest; +import spec.sdk.reactor.v1.domain.core.state.State; +import spec.sdk.reactor.v1.domain.core.state.StateOptions; +import spec.sdk.reactor.v1.domain.core.state.TransactionalStateOperation; +import spec.sdk.reactor.v1.utils.TypeRef; + +import java.util.List; + +/** + * State Management Runtimes standard API defined. + */ +public interface StateRuntimes { + + /** + * Retrieve a State based on their key. + * + * @param storeName The name of the state store. + * @param state State to be re-retrieved. + * @param type The type of State needed as return. + * @param The type of the return. + * @return A Mono Plan for the requested State. + */ + Mono> getState(String storeName, State state, TypeRef type); + + /** + * Retrieve a State based on their key. + * + * @param storeName The name of the state store. + * @param state State to be re-retrieved. + * @param clazz The type of State needed as return. + * @param The type of the return. + * @return A Mono Plan for the requested State. + */ + Mono> getState(String storeName, State state, Class clazz); + + /** + * Retrieve a State based on their key. + * + * @param storeName The name of the state store. + * @param key The key of the State to be retrieved. + * @param type The type of State needed as return. + * @param The type of the return. + * @return A Mono Plan for the requested State. + */ + Mono> getState(String storeName, String key, TypeRef type); + + /** + * Retrieve a State based on their key. + * + * @param storeName The name of the state store. + * @param key The key of the State to be retrieved. + * @param clazz The type of State needed as return. + * @param The type of the return. + * @return A Mono Plan for the requested State. + */ + Mono> getState(String storeName, String key, Class clazz); + + /** + * Retrieve a State based on their key. + * + * @param storeName The name of the state store. + * @param key The key of the State to be retrieved. + * @param options Optional settings for retrieve operation. + * @param type The Type of State needed as return. + * @param The Type of the return. + * @return A Mono Plan for the requested State. + */ + Mono> getState(String storeName, String key, StateOptions options, TypeRef type); + + /** + * Retrieve a State based on their key. + * + * @param storeName The name of the state store. + * @param key The key of the State to be retrieved. + * @param options Optional settings for retrieve operation. + * @param clazz The Type of State needed as return. + * @param The Type of the return. + * @return A Mono Plan for the requested State. + */ + Mono> getState(String storeName, String key, StateOptions options, Class clazz); + + /** + * Retrieve a State based on their key. + * + * @param request The request to get state. + * @param type The Type of State needed as return. + * @param The Type of the return. + * @return A Mono Plan for the requested State. + */ + Mono> getState(GetStateRequest request, TypeRef type); + + /** + * Retrieve bulk States based on their keys. + * + * @param storeName The name of the state store. + * @param keys The keys of the State to be retrieved. + * @param type The type of State needed as return. + * @param The type of the return. + * @return A Mono Plan for the requested State. + */ + Mono>> getBulkState(String storeName, List keys, TypeRef type); + + /** + * Retrieve bulk States based on their keys. + * + * @param storeName The name of the state store. + * @param keys The keys of the State to be retrieved. + * @param clazz The type of State needed as return. + * @param The type of the return. + * @return A Mono Plan for the requested State. + */ + Mono>> getBulkState(String storeName, List keys, Class clazz); + + /** + * Retrieve bulk States based on their keys. + * + * @param request The request to get state. + * @param type The Type of State needed as return. + * @param The Type of the return. + * @return A Mono Plan for the requested State. + */ + Mono>> getBulkState(GetBulkStateRequest request, TypeRef type); + + /** + * Execute a transaction. + * + * @param storeName The name of the state store. + * @param operations The operations to be performed. + * @return a Mono plan of type Void + */ + Mono executeStateTransaction(String storeName, + List> operations); + + /** + * Execute a transaction. + * + * @param request Request to execute transaction. + * @return a Mono plan of type Response Void + */ + Mono executeStateTransaction(ExecuteStateTransactionRequest request); + + /** + * Save/Update a list of states. + * + * @param storeName The name of the state store. + * @param states The States to be saved. + * @return a Mono plan of type Void. + */ + Mono saveBulkState(String storeName, List> states); + + /** + * Save/Update a list of states. + * + * @param request Request to save states. + * @return a Mono plan of type Void. + */ + Mono saveBulkState(SaveStateRequest request); + + /** + * Save/Update a state. + * + * @param storeName The name of the state store. + * @param key The key of the state. + * @param value The value of the state. + * @return a Mono plan of type Void. + */ + Mono saveState(String storeName, String key, Object value); + + /** + * Save/Update a state. + * + * @param storeName The name of the state store. + * @param key The key of the state. + * @param etag The etag to be used. + * @param value The value of the state. + * @param options The Options to use for each state. + * @return a Mono plan of type Void. + */ + Mono saveState(String storeName, String key, String etag, Object value, StateOptions options); + + /** + * Delete a state. + * + * @param storeName The name of the state store. + * @param key The key of the State to be removed. + * @return a Mono plan of type Void. + */ + Mono deleteState(String storeName, String key); + + /** + * Delete a state. + * + * @param storeName The name of the state store. + * @param key The key of the State to be removed. + * @param etag Optional etag for conditional delete. + * @param options Optional settings for state operation. + * @return a Mono plan of type Void. + */ + Mono deleteState(String storeName, String key, String etag, StateOptions options); + + /** + * Delete a state. + * + * @param request Request to delete a state. + * @return a Mono plan of type Void. + */ + Mono deleteState(DeleteStateRequest request); +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/ConfigurationItem.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/ConfigurationItem.java new file mode 100644 index 0000000..a456d87 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/ConfigurationItem.java @@ -0,0 +1,94 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.configuration; + +import java.util.Map; + +public class ConfigurationItem { + + /** + * Required. The key of configuration item + */ + private String key; + /** + * The content of configuration item + * Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set. + */ + private T content; + /** + * The group of configuration item. + */ + private String group; + /** + * The label of configuration item. + */ + private String label; + /** + * The tag list of configuration item. + */ + private Map tags; + /** + * The metadata which will be passed to configuration store component. + */ + private Map metadata; + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public T getContent() { + return content; + } + + public void setContent(T content) { + this.content = content; + } + + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public Map getTags() { + return tags; + } + + public void setTags(Map tags) { + this.tags = tags; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/ConfigurationRequestItem.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/ConfigurationRequestItem.java new file mode 100644 index 0000000..3c937dd --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/ConfigurationRequestItem.java @@ -0,0 +1,98 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.configuration; + +import java.util.List; +import java.util.Map; + +/** + * ConfigurationRequestItem used for GET,DEL,SUB request + */ +public class ConfigurationRequestItem { + + /** + * The name of configuration store. + */ + private String storeName; + /** + * The application id which + * Only used for admin, Ignored and reset for normal client + */ + private String appId; + /** + * The group of keys. + */ + private String group; + /** + * The label for keys. + */ + private String label; + /** + * The keys to get. + */ + private List keys; + /** + * The metadata which will be sent to configuration store components. + */ + private Map metadata; + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public String getGroup() { + return group; + } + + public void setGroup(String group) { + this.group = group; + } + + public String getLabel() { + return label; + } + + public void setLabel(String label) { + this.label = label; + } + + public List getKeys() { + return keys; + } + + public void setKeys(List keys) { + this.keys = keys; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/ConfigurationRequestItemBuilder.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/ConfigurationRequestItemBuilder.java new file mode 100644 index 0000000..1c2ad76 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/ConfigurationRequestItemBuilder.java @@ -0,0 +1,77 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.configuration; + +import java.util.List; +import java.util.Map; + +/** + * Builds a request to invoke configuration. + */ +public class ConfigurationRequestItemBuilder { + + private final String storeName; + + private final String appId; + + private String group; + + private String label; + + private List keys; + + private Map metadata; + + public ConfigurationRequestItemBuilder(String storeName, String appId) { + this.storeName = storeName; + this.appId = appId; + } + + public ConfigurationRequestItemBuilder withGroup(String group) { + this.group = group; + return this; + } + + public ConfigurationRequestItemBuilder withLabel(String label) { + this.label = label; + return this; + } + + public ConfigurationRequestItemBuilder withKeys(List keys) { + this.keys = keys; + return this; + } + + public ConfigurationRequestItemBuilder withMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** + * Builds a request object. + * + * @return Request object. + */ + public ConfigurationRequestItem build() { + ConfigurationRequestItem request = new ConfigurationRequestItem(); + request.setStoreName(this.appId); + request.setAppId(this.appId); + request.setGroup(this.group); + request.setLabel(this.label); + request.setKeys(this.keys); + request.setMetadata(this.metadata); + return request; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/SaveConfigurationRequest.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/SaveConfigurationRequest.java new file mode 100644 index 0000000..9fc5cf6 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/SaveConfigurationRequest.java @@ -0,0 +1,72 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.configuration; + +import java.util.List; +import java.util.Map; + +public class SaveConfigurationRequest { + + /** + * The name of configuration store. + */ + private String storeName; + /** + * The application id which + * Only used for admin, Ignored and reset for normal client + */ + private String appId; + /** + * The list of configuration items to save. + * To delete a exist item, set the key (also label) and let content to be empty + */ + private List> items; + /** + * The metadata which will be sent to configuration store components. + */ + private Map metadata; + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public List> getItems() { + return items; + } + + public void setItems(List> items) { + this.items = items; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/SubConfigurationResp.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/SubConfigurationResp.java new file mode 100644 index 0000000..4fe44ae --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/configuration/SubConfigurationResp.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.configuration; + +import java.util.List; + +public class SubConfigurationResp { + + /** + * The name of configuration store. + */ + private String storeName; + /** + * The application id which + * Only used for admin, Ignored and reset for normal client + */ + private String appId; + /** + * The list of configuration items to save. + * To delete a exist item, set the key (also label) and let content to be empty + */ + private List> items; + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getAppId() { + return appId; + } + + public void setAppId(String appId) { + this.appId = appId; + } + + public List> getItems() { + return items; + } + + public void setItems(List> items) { + this.items = items; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/invocation/HttpExtension.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/invocation/HttpExtension.java new file mode 100644 index 0000000..8a7a64e --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/invocation/HttpExtension.java @@ -0,0 +1,162 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.invocation; + +import okhttp3.HttpUrl; + +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * HTTP Extension class. + * This class is only needed if the app you are calling is listening on HTTP. + * It contains properties that represent data that may be populated for an HTTP receiver. + */ +public final class HttpExtension { + + /** + * Convenience HttpExtension object for {@link HttpMethods#NONE} with empty queryString. + */ + public static final HttpExtension NONE = new HttpExtension(HttpMethods.NONE); + /** + * Convenience HttpExtension object for the {@link HttpMethods#GET} Verb with empty queryString. + */ + public static final HttpExtension GET = new HttpExtension(HttpMethods.GET); + /** + * Convenience HttpExtension object for the {@link HttpMethods#PUT} Verb with empty queryString. + */ + public static final HttpExtension PUT = new HttpExtension(HttpMethods.PUT); + /** + * Convenience HttpExtension object for the {@link HttpMethods#POST} Verb with empty queryString. + */ + public static final HttpExtension POST = new HttpExtension(HttpMethods.POST); + /** + * Convenience HttpExtension object for the {@link HttpMethods#DELETE} Verb with empty queryString. + */ + public static final HttpExtension DELETE = new HttpExtension(HttpMethods.DELETE); + /** + * Convenience HttpExtension object for the {@link HttpMethods#HEAD} Verb with empty queryString. + */ + public static final HttpExtension HEAD = new HttpExtension(HttpMethods.HEAD); + /** + * Convenience HttpExtension object for the {@link HttpMethods#CONNECT} Verb with empty queryString. + */ + public static final HttpExtension CONNECT = new HttpExtension(HttpMethods.CONNECT); + /** + * Convenience HttpExtension object for the {@link HttpMethods#OPTIONS} Verb with empty queryString. + */ + public static final HttpExtension OPTIONS = new HttpExtension(HttpMethods.OPTIONS); + /** + * Convenience HttpExtension object for the {@link HttpMethods#TRACE} Verb with empty queryString. + */ + public static final HttpExtension TRACE = new HttpExtension(HttpMethods.TRACE); + + /** + * HTTP verb. + */ + private HttpMethods method; + + /** + * HTTP query params. + */ + private Map> queryParams; + + /** + * HTTP headers. + */ + private Map headers; + + /** + * Construct a HttpExtension object. + * + * @param method Required value denoting the HttpMethod. + * @param queryParams map for the query parameters the HTTP call. + * @param headers map to set HTTP headers. + * @throws IllegalArgumentException on null method or queryString. + * @see HttpMethods for supported methods. + */ + public HttpExtension(HttpMethods method, + Map> queryParams, + Map headers) { + if (method == null) { + throw new IllegalArgumentException("HttpExtension method cannot be null"); + } + + this.method = method; + this.queryParams = Collections.unmodifiableMap(queryParams == null ? Collections.emptyMap() : queryParams); + this.headers = Collections.unmodifiableMap(headers == null ? Collections.emptyMap() : headers); + } + + /** + * Construct a HttpExtension object. + * + * @param method Required value denoting the HttpMethod. + * @throws IllegalArgumentException on null method or queryString. + * @see HttpMethods for supported methods. + */ + public HttpExtension(HttpMethods method) { + this(method, null, null); + } + + public HttpMethods getMethod() { + return method; + } + + public Map> getQueryParams() { + return queryParams; + } + + public Map getHeaders() { + return headers; + } + + /** + * Encodes the query string for the HTTP request. + * + * @return Encoded HTTP query string. + */ + public String encodeQueryString() { + if ((this.queryParams == null) || (this.queryParams.isEmpty())) { + return ""; + } + + HttpUrl.Builder urlBuilder = new HttpUrl.Builder(); + // Setting required values but we only need query params in the end. + urlBuilder.scheme("http").host("localhost"); + Optional.ofNullable(this.queryParams).orElse(Collections.emptyMap()).entrySet().stream() + .forEach(urlParameter -> + Optional.ofNullable(urlParameter.getValue()).orElse(Collections.emptyList()).stream() + .forEach(urlParameterValue -> + urlBuilder.addQueryParameter(urlParameter.getKey(), urlParameterValue))); + return urlBuilder.build().encodedQuery(); + } + + /** + * HTTP Methods supported. + */ + public enum HttpMethods { + NONE, + GET, + PUT, + POST, + DELETE, + HEAD, + CONNECT, + OPTIONS, + TRACE + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/invocation/InvokeMethodRequest.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/invocation/InvokeMethodRequest.java new file mode 100644 index 0000000..696f3a5 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/invocation/InvokeMethodRequest.java @@ -0,0 +1,83 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.invocation; + +import java.util.Map; + +/** + * A request to invoke a service. + */ +public class InvokeMethodRequest { + + private final String appId; + + private final String method; + + private Object body; + + private HttpExtension httpExtension; + + private String contentType; + + private Map metadata; + + public InvokeMethodRequest(String appId, String method) { + this.appId = appId; + this.method = method; + } + + public String getAppId() { + return appId; + } + + public String getMethod() { + return method; + } + + public Object getBody() { + return body; + } + + public InvokeMethodRequest setBody(Object body) { + this.body = body; + return this; + } + + public HttpExtension getHttpExtension() { + return httpExtension; + } + + public InvokeMethodRequest setHttpExtension(HttpExtension httpExtension) { + this.httpExtension = httpExtension; + return this; + } + + public String getContentType() { + return contentType; + } + + public InvokeMethodRequest setContentType(String contentType) { + this.contentType = contentType; + return this; + } + + public Map getMetadata() { + return metadata; + } + + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/invocation/Metadata.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/invocation/Metadata.java new file mode 100644 index 0000000..19c00a2 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/invocation/Metadata.java @@ -0,0 +1,28 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.invocation; + +/** + * Enumerates commonly used metadata attributes. + */ +public final class Metadata { + + public static final String CONTENT_TYPE = "content-type"; + + public static final String TTL_IN_SECONDS = "ttlInSeconds"; + + private Metadata() { + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/pubsub/PublishEventRequest.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/pubsub/PublishEventRequest.java new file mode 100644 index 0000000..23ed0ab --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/pubsub/PublishEventRequest.java @@ -0,0 +1,78 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.pubsub; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +/** + * A request to publish an event. + */ +public class PublishEventRequest { + + private final String pubsubName; + + private final String topic; + + private final Object data; + + private String contentType; + + private Map metadata = new HashMap<>(); + + /** + * Constructor for PublishEventRequest. + * + * @param pubsubName name of the pubsub + * @param topic name of the topic in the pubsub + * @param data data to published + */ + public PublishEventRequest(String pubsubName, String topic, Object data) { + this.pubsubName = pubsubName; + this.topic = topic; + this.data = data; + } + + public String getPubsubName() { + return pubsubName; + } + + public String getTopic() { + return topic; + } + + public Object getData() { + return data; + } + + public String getContentType() { + return this.contentType; + } + + public PublishEventRequest setContentType(String contentType) { + this.contentType = contentType; + return this; + } + + public Map getMetadata() { + return metadata; + } + + public PublishEventRequest setMetadata(Map metadata) { + this.metadata = metadata == null ? null : Collections.unmodifiableMap(metadata); + return this; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/DeleteStateRequest.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/DeleteStateRequest.java new file mode 100644 index 0000000..2e36361 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/DeleteStateRequest.java @@ -0,0 +1,74 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.state; + +import java.util.Collections; +import java.util.Map; + +/** + * A request to delete a state by key. + */ +public class DeleteStateRequest { + + private final String stateStoreName; + + private final String key; + + private Map metadata; + + private String etag; + + private StateOptions stateOptions; + + public DeleteStateRequest(String storeName, String key) { + this.stateStoreName = storeName; + this.key = key; + } + + public String getStateStoreName() { + return stateStoreName; + } + + public String getKey() { + return key; + } + + public String getEtag() { + return etag; + } + + public DeleteStateRequest setEtag(String etag) { + this.etag = etag; + return this; + } + + public StateOptions getStateOptions() { + return stateOptions; + } + + public DeleteStateRequest setStateOptions(StateOptions stateOptions) { + this.stateOptions = stateOptions; + return this; + } + + public Map getMetadata() { + return metadata; + } + + public DeleteStateRequest setMetadata(Map metadata) { + this.metadata = metadata == null ? null : Collections.unmodifiableMap(metadata); + return this; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/ExecuteStateTransactionRequest.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/ExecuteStateTransactionRequest.java new file mode 100644 index 0000000..8bed077 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/ExecuteStateTransactionRequest.java @@ -0,0 +1,63 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.state; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public class ExecuteStateTransactionRequest { + + /** + * Name of the state store. + */ + private final String stateStoreName; + + /** + * Transactional operations list. + */ + private List> operations; + + /** + * Metadata used for transactional operations. + */ + private Map metadata; + + public ExecuteStateTransactionRequest(String stateStoreName) { + this.stateStoreName = stateStoreName; + } + + public String getStateStoreName() { + return stateStoreName; + } + + public ExecuteStateTransactionRequest setOperations(List> operations) { + this.operations = operations == null ? null : Collections.unmodifiableList(operations); + return this; + } + + public List> getOperations() { + return operations; + } + + public ExecuteStateTransactionRequest setMetadata(Map metadata) { + this.metadata = metadata == null ? null : Collections.unmodifiableMap(metadata); + return this; + } + + public Map getMetadata() { + return metadata; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/GetBulkStateRequest.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/GetBulkStateRequest.java new file mode 100644 index 0000000..11c5f5a --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/GetBulkStateRequest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.state; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * A request to get bulk state by keys. + */ +public class GetBulkStateRequest { + + private final String storeName; + + private final List keys; + + private Map metadata; + + private int parallelism = 1; + + public GetBulkStateRequest(String storeName, List keys) { + this.storeName = storeName; + this.keys = keys == null ? null : Collections.unmodifiableList(keys); + } + + public GetBulkStateRequest(String storeName, String... keys) { + this.storeName = storeName; + this.keys = keys == null ? null : Collections.unmodifiableList(Arrays.asList(keys)); + } + + public String getStoreName() { + return storeName; + } + + public List getKeys() { + return keys; + } + + public int getParallelism() { + return parallelism; + } + + public GetBulkStateRequest setParallelism(int parallelism) { + this.parallelism = parallelism; + return this; + } + + public Map getMetadata() { + return metadata; + } + + public GetBulkStateRequest setMetadata(Map metadata) { + this.metadata = metadata == null ? null : Collections.unmodifiableMap(metadata); + return this; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/GetStateRequest.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/GetStateRequest.java new file mode 100644 index 0000000..141ef0e --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/GetStateRequest.java @@ -0,0 +1,63 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.state; + +import java.util.Collections; +import java.util.Map; + +/** + * A request to get a state by key. + */ +public class GetStateRequest { + + private final String storeName; + + private final String key; + + private Map metadata; + + private StateOptions stateOptions; + + public GetStateRequest(String storeName, String key) { + this.storeName = storeName; + this.key = key; + } + + public String getStoreName() { + return storeName; + } + + public String getKey() { + return key; + } + + public StateOptions getStateOptions() { + return stateOptions; + } + + public GetStateRequest setStateOptions(StateOptions stateOptions) { + this.stateOptions = stateOptions; + return this; + } + + public Map getMetadata() { + return metadata; + } + + public GetStateRequest setMetadata(Map metadata) { + this.metadata = metadata == null ? null : Collections.unmodifiableMap(metadata); + return this; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/SaveStateRequest.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/SaveStateRequest.java new file mode 100644 index 0000000..da6aca2 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/SaveStateRequest.java @@ -0,0 +1,51 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.state; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * A request to save states to state store. + */ +public class SaveStateRequest { + + private final String storeName; + + private List> states; + + public SaveStateRequest(String storeName) { + this.storeName = storeName; + } + + public String getStoreName() { + return storeName; + } + + public List> getStates() { + return states; + } + + public SaveStateRequest setStates(List> states) { + this.states = states == null ? null : Collections.unmodifiableList(states); + return this; + } + + public SaveStateRequest setStates(State... states) { + this.states = Collections.unmodifiableList(Arrays.asList(states)); + return this; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/State.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/State.java new file mode 100644 index 0000000..c25f733 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/State.java @@ -0,0 +1,276 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.state; + +import java.util.Map; + +/** + * This class reprent what a State is. + * + * @param The type of the value of the sate + */ +public class State { + + /** + * The value of the state. + */ + private final T value; + + /** + * The key of the state. + */ + private final String key; + + /** + * The ETag to be used + * Keep in mind that for some state stores (like redis) only numbers are supported. + */ + private final String etag; + + /** + * The metadata which will be passed to state store component. + */ + private final Map metadata; + + /** + * The error in case the key could not be retrieved. + */ + private final String error; + + /** + * The options used for saving the state. + */ + private final StateOptions options; + + /** + * Create an immutable state reference to be retrieved or deleted. + * This Constructor CAN be used anytime you need to retrieve or delete a state. + * + * @param key - The key of the state + */ + public State(String key) { + this.key = key; + this.value = null; + this.etag = null; + this.metadata = null; + this.options = null; + this.error = null; + } + + /** + * Create an immutable state reference to be retrieved or deleted. + * This Constructor CAN be used anytime you need to retrieve or delete a state. + * + * @param key - The key of the state + * @param etag - The etag of the state - Keep in mind that for some state stores (like redis) only numbers + * are supported. + * @param options - REQUIRED when saving a state. + */ + public State(String key, String etag, StateOptions options) { + this.value = null; + this.key = key; + this.etag = etag; + this.metadata = null; + this.options = options; + this.error = null; + } + + /** + * Create an immutable state. + * This Constructor CAN be used anytime you want the state to be saved. + * + * @param key - The key of the state. + * @param value - The value of the state. + * @param etag - The etag of the state - for some state stores (like redis) only numbers are supported. + * @param options - REQUIRED when saving a state. + */ + public State(String key, T value, String etag, StateOptions options) { + this.value = value; + this.key = key; + this.etag = etag; + this.metadata = null; + this.options = options; + this.error = null; + } + + /** + * Create an immutable state. + * This Constructor CAN be used anytime you want the state to be saved. + * + * @param key - The key of the state. + * @param value - The value of the state. + * @param etag - The etag of the state - for some state stores (like redis) only numbers are supported. + * @param metadata - The metadata of the state. + * @param options - REQUIRED when saving a state. + */ + public State(String key, T value, String etag, Map metadata, StateOptions options) { + this.value = value; + this.key = key; + this.etag = etag; + this.metadata = metadata; + this.options = options; + this.error = null; + } + + /** + * Create an immutable state. + * This Constructor CAN be used anytime you want the state to be saved. + * + * @param key - The key of the state. + * @param value - The value of the state. + * @param etag - The etag of the state - some state stores (like redis) only numbers are supported. + */ + public State(String key, T value, String etag) { + this.value = value; + this.key = key; + this.etag = etag; + this.metadata = null; + this.options = null; + this.error = null; + } + + /** + * Create an immutable state. + * This Constructor MUST be used anytime the key could not be retrieved and contains an error. + * + * @param key - The key of the state. + * @param error - Error when fetching the state. + */ + public State(String key, String error) { + this.value = null; + this.key = key; + this.etag = null; + this.metadata = null; + this.options = null; + this.error = error; + } + + /** + * Retrieves the Value of the state. + * + * @return The value of the state + */ + public T getValue() { + return value; + } + + /** + * Retrieves the Key of the state. + * + * @return The key of the state + */ + public String getKey() { + return key; + } + + /** + * Retrieve the ETag of this state. + * + * @return The etag of the state + */ + public String getEtag() { + return etag; + } + + /** + * Retrieve the metadata of this state. + * + * @return the metadata of this state + */ + public Map getMetadata() { + return metadata; + } + + /** + * Retrieve the error for this state. + * + * @return The error for this state. + */ + + public String getError() { + return error; + } + + /** + * Retrieve the Options used for saving the state. + * + * @return The options to save the state + */ + public StateOptions getOptions() { + return options; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + + if (!(o instanceof State)) { + return false; + } + + State that = (State) o; + + if (getValue() != null ? !getValue().equals(that.getValue()) : that.getValue() != null) { + return false; + } + + if (getKey() != null ? !getKey().equals(that.getKey()) : that.getKey() != null) { + return false; + } + + if (getEtag() != null ? !getEtag().equals(that.getEtag()) : that.getEtag() != null) { + return false; + } + + if (getError() != null ? !getError().equals(that.getError()) : that.getError() != null) { + return false; + } + + if (getMetadata() != null ? !getMetadata().equals(that.getMetadata()) : that.getMetadata() != null) { + return false; + } + + if (getOptions() != null ? !getOptions().equals(that.getOptions()) : that.getOptions() != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = getValue() != null ? getValue().hashCode() : 0; + result = 31 * result + (getKey() != null ? getKey().hashCode() : 0); + result = 31 * result + (getEtag() != null ? getEtag().hashCode() : 0); + result = 31 * result + (getMetadata() != null ? getMetadata().hashCode() : 0); + result = 31 * result + (getError() != null ? getError().hashCode() : 0); + result = 31 * result + (getOptions() != null ? options.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "StateKeyValue{" + + "key='" + key + "'" + + ", value=" + value + + ", etag='" + etag + "'" + + ", metadata={'" + (metadata != null ? metadata.toString() : null) + "'}" + + ", error='" + error + "'" + + ", options={'" + (options != null ? options.toString() : null) + "'}" + + "}"; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/StateOptions.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/StateOptions.java new file mode 100644 index 0000000..2874b42 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/StateOptions.java @@ -0,0 +1,101 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.state; + +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; + +public class StateOptions { + + private final Consistency consistency; + private final Concurrency concurrency; + + /** + * Represents options for a CloudRuntimes state API call. + * + * @param consistency The consistency mode. + * @param concurrency The concurrency mode. + */ + public StateOptions(Consistency consistency, Concurrency concurrency) { + this.consistency = consistency; + this.concurrency = concurrency; + } + + public Concurrency getConcurrency() { + return concurrency; + } + + public Consistency getConsistency() { + return consistency; + } + + /** + * Returns state options as a Map of option name to value. + * + * @return A map of state options. + */ + public Map getStateOptionsAsMap() { + Map mapOptions = new HashMap<>(); + if (this.getConsistency() != null) { + mapOptions.put("consistency", this.getConsistency().getValue()); + } + if (this.getConcurrency() != null) { + mapOptions.put("concurrency", this.getConcurrency().getValue()); + } + return Collections.unmodifiableMap(Optional.ofNullable(mapOptions).orElse(Collections.EMPTY_MAP)); + } + + public enum Consistency { + + EVENTUAL("eventual"), + STRONG("strong"); + + private final String value; + + Consistency(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } + + public static Consistency fromValue(String value) { + return Consistency.valueOf(value); + } + } + + public enum Concurrency { + + FIRST_WRITE("first-write"), + LAST_WRITE("last-write"); + + private final String value; + + Concurrency(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } + + public static Concurrency fromValue(String value) { + return Concurrency.valueOf(value); + } + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/TransactionalStateOperation.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/TransactionalStateOperation.java new file mode 100644 index 0000000..81f8d17 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/TransactionalStateOperation.java @@ -0,0 +1,80 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.state; + +import java.util.Objects; + +public class TransactionalStateOperation { + + /** + * The type of operation to be executed. + */ + private final OperationType operation; + + /** + * State values to be operated on. + */ + private final State request; + + /** + * Construct an immutable transactional state operation object. + * + * @param operationType The type of operation done. + * @param state The required state. + */ + public TransactionalStateOperation(OperationType operationType, State state) { + this.operation = operationType; + this.request = state; + } + + public OperationType getOperation() { + return operation; + } + + public State getRequest() { + return request; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TransactionalStateOperation that = (TransactionalStateOperation) o; + return operation.equals(that.operation) + && request.equals(that.request); + } + + @Override + public int hashCode() { + return Objects.hash(operation, request); + } + + @Override + public String toString() { + return "TransactionalStateOperation{" + + "operationType='" + operation + '\'' + + ", state=" + request + + '}'; + } + + public enum OperationType { + UPSERT, + DELETE + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/TransactionalStateRequest.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/TransactionalStateRequest.java new file mode 100644 index 0000000..620b306 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/core/state/TransactionalStateRequest.java @@ -0,0 +1,51 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.core.state; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public class TransactionalStateRequest { + + /** + * Transactional operations list. + */ + private final List> operations; + + /** + * Metadata used for transactional operations. + */ + private final Map metadata; + + /** + * Constructor to create immutable transactional state request object. + * + * @param operations List of operations to be performed. + * @param metadata Metadata used for transactional operations. + */ + public TransactionalStateRequest(List> operations, Map metadata) { + this.operations = operations; + this.metadata = metadata; + } + + public List> getOperations() { + return Collections.unmodifiableList(operations); + } + + public Map getMetadata() { + return metadata; + } +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/enhanced/MetricsRuntimes.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/enhanced/MetricsRuntimes.java new file mode 100644 index 0000000..db5069b --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/enhanced/MetricsRuntimes.java @@ -0,0 +1,24 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.domain.enhanced; + +/** + * Metrics Runtimes standard API defined. + */ +public interface MetricsRuntimes { + + // TODO: 2021/8/31 API + // see https://github.com/reactivegroup/cloud-runtimes-jvm/issues/2 +} diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/package-info.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/package-info.java new file mode 100644 index 0000000..c046d9e --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/domain/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * Building blocks address common challenges in building resilient, microservices applications and codify best practices and patterns. + * CloudRuntimes consists of a set of building blocks, with extensibility to add new building blocks. + */ +package spec.sdk.reactor.v1.domain; \ No newline at end of file diff --git a/sdk-reactor/src/main/java/spec/sdk/reactor/v1/utils/TypeRef.java b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/utils/TypeRef.java new file mode 100644 index 0000000..7f6ded6 --- /dev/null +++ b/sdk-reactor/src/main/java/spec/sdk/reactor/v1/utils/TypeRef.java @@ -0,0 +1,162 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.reactor.v1.utils; + +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; + +/** + * Used to reference a type. + * + *

Usage: new TypeRef<MyClass>(){}

+ * + * @param Type to be deserialized. + */ +public abstract class TypeRef { + + public static final TypeRef STRING = new TypeRef() { + }; + + public static final TypeRef BOOLEAN = new TypeRef(boolean.class) { + }; + + public static final TypeRef INT = new TypeRef(int.class) { + }; + + public static final TypeRef LONG = new TypeRef(long.class) { + }; + + public static final TypeRef CHAR = new TypeRef(char.class) { + }; + + public static final TypeRef BYTE = new TypeRef(byte.class) { + }; + + public static final TypeRef VOID = new TypeRef(void.class) { + }; + + public static final TypeRef FLOAT = new TypeRef(float.class) { + }; + + public static final TypeRef DOUBLE = new TypeRef(double.class) { + }; + + public static final TypeRef BYTE_ARRAY = new TypeRef() { + }; + + public static final TypeRef INT_ARRAY = new TypeRef() { + }; + + public static final TypeRef STRING_ARRAY = new TypeRef() { + }; + + private final Type type; + + /** + * Constructor. + */ + public TypeRef() { + Type superClass = this.getClass().getGenericSuperclass(); + if (superClass instanceof Class) { + throw new IllegalArgumentException("TypeReference requires type."); + } + + this.type = ((ParameterizedType) superClass).getActualTypeArguments()[0]; + } + + /** + * Constructor for reflection. + * + * @param type Type to be referenced. + */ + private TypeRef(Type type) { + this.type = type; + } + + /** + * Gets the type referenced. + * + * @return type referenced. + */ + public Type getType() { + return this.type; + } + + /** + * Creates a reference to a given class type. + * + * @param clazz Class type to be referenced. + * @param Type to be referenced. + * @return Class type reference. + */ + public static TypeRef get(Class clazz) { + if (clazz == String.class) { + return (TypeRef) STRING; + } + if (clazz == boolean.class) { + return (TypeRef) BOOLEAN; + } + if (clazz == int.class) { + return (TypeRef) INT; + } + if (clazz == long.class) { + return (TypeRef) LONG; + } + if (clazz == char.class) { + return (TypeRef) CHAR; + } + if (clazz == byte.class) { + return (TypeRef) BYTE; + } + if (clazz == void.class) { + return (TypeRef) VOID; + } + if (clazz == float.class) { + return (TypeRef) FLOAT; + } + if (clazz == double.class) { + return (TypeRef) DOUBLE; + } + if (clazz == byte[].class) { + return (TypeRef) BYTE_ARRAY; + } + if (clazz == int[].class) { + return (TypeRef) INT_ARRAY; + } + if (clazz == String[].class) { + return (TypeRef) STRING_ARRAY; + } + + return new TypeRef(clazz) { + }; + } + + /** + * Creates a reference to a given class type. + * + * @param type Type to be referenced. + * @param Type to be referenced. + * @return Class type reference. + */ + public static TypeRef get(Type type) { + if (type instanceof Class) { + Class clazz = (Class) type; + return get(clazz); + } + + return new TypeRef(type) { + }; + } +} diff --git a/sdk/pom.xml b/sdk/pom.xml new file mode 100644 index 0000000..792b2e7 --- /dev/null +++ b/sdk/pom.xml @@ -0,0 +1,106 @@ + + + 4.0.0 + + + io.mosn.layotto + runtime-sdk-parent + 1.1.0-SNAPSHOT + + + runtime-sdk + runtime-sdk + SDK for Runtime + jar + + + + + io.mosn.layotto + runtime-spec-pb + + + + com.alibaba + fastjson + + + + org.slf4j + slf4j-api + + + + io.grpc + grpc-all + + + + junit + junit + test + + + org.mockito + mockito-core + test + + + + + src/main/java + + + src/main/resources + true + + **/** + + + + proto + true + + **/*.proto + + + + + src/test/java + + + src/test/resources + true + + **/** + + + + + + + kr.motd.maven + os-maven-plugin + 1.4.1.Final + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + + jar + + + + + + + + diff --git a/sdk/src/main/java/io/mosn/layotto/v1/AbstractRuntimeClient.java b/sdk/src/main/java/io/mosn/layotto/v1/AbstractRuntimeClient.java new file mode 100644 index 0000000..16ca30c --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/AbstractRuntimeClient.java @@ -0,0 +1,300 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import io.mosn.layotto.v1.config.RuntimeProperties; +import io.mosn.layotto.v1.exceptions.RuntimeClientException; +import io.mosn.layotto.v1.serializer.ObjectSerializer; +import org.slf4j.Logger; +import spec.sdk.runtime.v1.client.RuntimeClient; +import spec.sdk.runtime.v1.domain.invocation.InvokeResponse; +import spec.sdk.runtime.v1.domain.state.DeleteStateRequest; +import spec.sdk.runtime.v1.domain.state.ExecuteStateTransactionRequest; +import spec.sdk.runtime.v1.domain.state.GetBulkStateRequest; +import spec.sdk.runtime.v1.domain.state.GetStateRequest; +import spec.sdk.runtime.v1.domain.state.SaveStateRequest; +import spec.sdk.runtime.v1.domain.state.State; +import spec.sdk.runtime.v1.domain.state.StateOptions; +import spec.sdk.runtime.v1.domain.state.TransactionalStateOperation; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public abstract class AbstractRuntimeClient implements RuntimeClient { + + /** + * Runtime client logger. + */ + protected final Logger logger; + /** + * Serializer used for state objects. + */ + protected final ObjectSerializer stateSerializer; + /** + * Runtime invocation timeout ms. + */ + private final int timeoutMs; + + AbstractRuntimeClient(Logger logger, int timeoutMs, ObjectSerializer stateSerializer) { + if (logger == null) { + throw new IllegalArgumentException("logger shouldn't be null"); + } + if (stateSerializer == null) { + throw new IllegalArgumentException("stateSerializer shouldn't be null"); + } + this.logger = logger; + this.timeoutMs = timeoutMs; + this.stateSerializer = stateSerializer; + } + + @Override + public String sayHello(String name) { + return this.sayHello(name, this.getTimeoutMs()); + } + + @Override + public InvokeResponse invokeMethod(String appId, String methodName, byte[] data, Map header) { + return this.invokeMethod(appId, methodName, data, header, this.getTimeoutMs()); + } + + // TODO add some methods that serialize data before invoking method + + @Override + public void publishEvent(String pubsubName, String topicName, byte[] data) { + Map metadata = new HashMap<>(2, 1); + this.publishEvent(pubsubName, topicName, data, RuntimeProperties.DEFAULT_PUBSUB_CONTENT_TYPE, metadata); + } + + @Override + public void publishEvent(String pubsubName, String topicName, byte[] data, Map metadata) { + this.publishEvent(pubsubName, topicName, data, RuntimeProperties.DEFAULT_PUBSUB_CONTENT_TYPE, metadata); + } + + /** + * Retrieve a State based on their key. + * + * @param storeName The name of the state store. + * @param key The key of the State to be retrieved. + * @param clazz The type of State needed as return. + */ + @Override + public State getState(String storeName, String key, Class clazz) { + return this.getState(storeName, key, null, clazz); + } + + /** + * Retrieve a State based on their key. + * + * @param storeName The name of the state store. + * @param key The key of the State to be retrieved. + * @param options Optional settings for retrieve operation. + * @param clazz The Type of State needed as return. + */ + @Override + public State getState(String storeName, String key, StateOptions options, Class clazz) { + GetStateRequest request = new GetStateRequest(storeName, key); + request.setStateOptions(options); + return this.getState(request, clazz); + } + + /** + * Retrieve a State based on their key. + * + * @param request The request to get state. + * @param clazz The Class of State needed as return. + * @return The requested State. + */ + @Override + public State getState(GetStateRequest request, Class clazz) { + return getState(request, clazz, getTimeoutMs()); + } + + @Override + public State getState(GetStateRequest request, Class clazz, int timeoutMs) { + // 1. validate + if (clazz == null) { + throw new IllegalArgumentException("clazz cannot be null."); + } + final String stateStoreName = request.getStoreName(); + if ((stateStoreName == null) || (stateStoreName.trim().isEmpty())) { + throw new IllegalArgumentException("State store name cannot be null or empty."); + } + final String key = request.getKey(); + if ((key == null) || (key.trim().isEmpty())) { + throw new IllegalArgumentException("Key cannot be null or empty."); + } + // 2. invoke + State state = doGetState(request, timeoutMs); + try { + // 3. deserialize + T value = null; + byte[] data = state.getValue(); + if (data != null) { + value = stateSerializer.deserialize(data, clazz); + } + return new State<>(state.getKey(), value, state.getEtag(), state.getMetadata(), state.getOptions()); + } catch (Exception e) { + logger.error("getState error ", e); + throw new RuntimeClientException(e); + } + } + + protected abstract State doGetState(GetStateRequest request, int timeoutMs); + + /** + * {@inheritDoc} + */ + @Override + public void deleteState(String storeName, String key) { + this.deleteState(storeName, key, null, null); + } + + /** + * {@inheritDoc} + */ + @Override + public void deleteState(String storeName, String key, String etag, StateOptions options) { + DeleteStateRequest request = new DeleteStateRequest(storeName, key); + request.setEtag(etag); + request.setStateOptions(options); + this.deleteState(request); + } + + /** + * Delete a state. + * + * @param request Request to delete a state. + */ + @Override + public void deleteState(DeleteStateRequest request) { + deleteState(request, getTimeoutMs()); + } + + /** + * {@inheritDoc} + */ + @Override + public void saveState(String storeName, String key, Object value) { + Map metadata = new HashMap<>(2, 1); + this.saveState(storeName, key, null, value, null, metadata); + } + + /** + * {@inheritDoc} + */ + @Override + public void saveState(String storeName, String key, String etag, Object value, StateOptions options, Map metadata) { + State state = new State<>(key, value, etag, metadata, options); + List> states = Collections.singletonList(state); + this.saveBulkState(storeName, states); + } + + /** + * {@inheritDoc} + */ + @Override + public void saveBulkState(String storeName, List> states) { + SaveStateRequest request = new SaveStateRequest(storeName); + request.setStates(states); + this.saveBulkState(request); + } + + /** + * {@inheritDoc} + */ + @Override + public void saveBulkState(SaveStateRequest request) { + saveBulkState(request, getTimeoutMs()); + } + + /** + * {@inheritDoc} + */ + @Override + public void executeStateTransaction(String storeName, List> operations) { + ExecuteStateTransactionRequest request = new ExecuteStateTransactionRequest(storeName); + request.setOperations(operations); + this.executeStateTransaction(request); + } + + /** + * {@inheritDoc} + */ + @Override + public List> getBulkState(String storeName, List keys, Class clazz) { + GetBulkStateRequest request = new GetBulkStateRequest(storeName, keys); + return this.getBulkState(request, clazz); + } + + @Override + public List> getBulkState(GetBulkStateRequest request, Class clazz) { + return getBulkState(request, clazz, getTimeoutMs()); + } + + @Override + public List> getBulkState(GetBulkStateRequest request, Class clazz, int timeoutMs) { + // 1. validate + if (clazz == null) { + throw new IllegalArgumentException("clazz cannot be null."); + } + final String stateStoreName = request.getStoreName(); + final List keys = request.getKeys(); + final int parallelism = request.getParallelism(); + + if ((stateStoreName == null) || (stateStoreName.trim().isEmpty())) { + throw new IllegalArgumentException("State store name cannot be null or empty."); + } + if (keys == null || keys.isEmpty()) { + throw new IllegalArgumentException("Key cannot be null or empty."); + } + if (parallelism < 0) { + throw new IllegalArgumentException("Parallelism cannot be negative."); + } + + try { + // 2. invoke + List> bulkState = doGetBulkState(request, timeoutMs); + // 3. deserialize + List> result = new ArrayList<>(bulkState.size()); + for (State state : bulkState) { + byte[] value = state.getValue(); + T deValue = null; + if (value != null) { + deValue = stateSerializer.deserialize(value, clazz); + } + State tState = new State<>(state.getKey(), deValue, state.getEtag(), state.getMetadata(), state.getOptions()); + result.add(tState); + } + return result; + } catch (Exception e) { + logger.error("getBulkState error ", e); + throw new RuntimeClientException(e); + } + } + + protected abstract List> doGetBulkState(GetBulkStateRequest request, int timeoutMs); + + /** + * Getter method for property timeoutMs. + * + * @return property value of timeoutMs + */ + public int getTimeoutMs() { + return this.timeoutMs; + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/RuntimeClientBuilder.java b/sdk/src/main/java/io/mosn/layotto/v1/RuntimeClientBuilder.java new file mode 100644 index 0000000..f488d18 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/RuntimeClientBuilder.java @@ -0,0 +1,198 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import com.google.errorprone.annotations.DoNotCall; +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.mosn.layotto.v1.config.RuntimeProperties; +import io.mosn.layotto.v1.domain.ApiProtocol; +import io.mosn.layotto.v1.grpc.GrpcRuntimeClient; +import io.mosn.layotto.v1.grpc.stub.PooledStubManager; +import io.mosn.layotto.v1.grpc.stub.SingleStubManager; +import io.mosn.layotto.v1.grpc.stub.StubCreator; +import io.mosn.layotto.v1.grpc.stub.StubManager; +import io.mosn.layotto.v1.serializer.JSONSerializer; +import io.mosn.layotto.v1.serializer.ObjectSerializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.sdk.runtime.v1.client.RuntimeClient; + +/** + * A builder for the RuntimeClient, + */ +public class RuntimeClientBuilder { + + private static final Logger DEFAULT_LOGGER = LoggerFactory.getLogger(RuntimeClient.class.getName()); + + private int timeoutMs = RuntimeProperties.DEFAULT_TIMEOUT_MS; + + private String ip = RuntimeProperties.DEFAULT_IP; + + private int port = RuntimeProperties.DEFAULT_PORT; + + private ApiProtocol protocol = RuntimeProperties.DEFAULT_API_PROTOCOL; + + private Logger logger = DEFAULT_LOGGER; + + private ObjectSerializer stateSerializer = new JSONSerializer(); + + private int poolSize; + + // TODO add rpc serializer + + /** + * Creates a constructor for RuntimeClient. + */ + public RuntimeClientBuilder() { + } + + public RuntimeClientBuilder withConnectionPoolSize(int poolSize) { + if (poolSize <= 0) { + throw new IllegalArgumentException("Invalid poolSize."); + } + this.poolSize = poolSize; + return this; + } + + public RuntimeClientBuilder withIp(String ip) { + if (ip == null || ip.isEmpty()) { + throw new IllegalArgumentException("Invalid ip."); + } + this.ip = ip; + return this; + } + + public RuntimeClientBuilder withPort(int port) { + if (port <= 0) { + throw new IllegalArgumentException("Invalid port."); + } + this.port = port; + return this; + } + + @DoNotCall + public RuntimeClientBuilder withApiProtocol(ApiProtocol protocol) { + if (protocol == null) { + throw new IllegalArgumentException("Invalid protocol."); + } + this.protocol = protocol; + return this; + } + + public RuntimeClientBuilder withTimeout(int timeoutMillisecond) { + if (timeoutMillisecond <= 0) { + throw new IllegalArgumentException("Invalid timeout."); + } + this.timeoutMs = timeoutMillisecond; + return this; + } + + public RuntimeClientBuilder withLogger(Logger logger) { + if (logger == null) { + throw new IllegalArgumentException("Invalid logger."); + } + this.logger = logger; + return this; + } + + /** + * Sets the serializer for objects to be persisted. + * + * @param stateSerializer Serializer for objects to be persisted. + * @return This instance. + */ + public RuntimeClientBuilder withStateSerializer(ObjectSerializer stateSerializer) { + if (stateSerializer == null) { + throw new IllegalArgumentException("State serializer is required"); + } + + this.stateSerializer = stateSerializer; + return this; + } + + /** + * Build an instance of the Client based on the provided setup. + * + * @return an instance of the setup Client + * @throws IllegalStateException if any required field is missing + */ + public RuntimeClient build() { + if (protocol == null) { + throw new IllegalStateException("Protocol is required."); + } + + switch (protocol) { + case GRPC: + return buildGrpc(); + default: + throw new IllegalStateException("Unsupported protocol: " + protocol.name()); + } + } + + public GrpcRuntimeClient buildGrpc() { + // 1. validate + if (port <= 0) { + throw new IllegalArgumentException("Invalid port."); + } + // 2. construct stubManager + StubManager stubManager; + if (poolSize > 1) { + stubManager = new PooledStubManager<>(ip, port, poolSize, new StubCreatorImpl()); + } else { + ManagedChannel channel = ManagedChannelBuilder.forAddress(ip, port) + .usePlaintext() + .build(); + stubManager = new SingleStubManager(channel, new StubCreatorImpl()); + } + // 3. construct client + return new RuntimeClientGrpc( + logger, + timeoutMs, + stateSerializer, + stubManager); + } + + public GrpcRuntimeClient buildGrpcWithExistingChannel(ManagedChannel channel) { + // 1. validate + if (port <= 0) { + throw new IllegalArgumentException("Invalid port."); + } + // 2. construct stubManager + StubManager stubManager = new SingleStubManager( + channel, new StubCreatorImpl()); + // 3. construct client + return new RuntimeClientGrpc( + logger, + timeoutMs, + stateSerializer, + stubManager); + } + + public static class StubCreatorImpl implements + StubCreator { + + @Override + public RuntimeGrpc.RuntimeStub createAsyncStub(ManagedChannel channel) { + return RuntimeGrpc.newStub(channel); + } + + @Override + public RuntimeGrpc.RuntimeBlockingStub createBlockingStub(ManagedChannel channel) { + return RuntimeGrpc.newBlockingStub(channel); + } + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/RuntimeClientGrpc.java b/sdk/src/main/java/io/mosn/layotto/v1/RuntimeClientGrpc.java new file mode 100644 index 0000000..21bf4a8 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/RuntimeClientGrpc.java @@ -0,0 +1,993 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import com.google.common.base.Strings; +import com.google.protobuf.Any; +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import io.grpc.Metadata; +import io.grpc.StatusRuntimeException; +import io.grpc.stub.MetadataUtils; +import io.grpc.stub.StreamObserver; +import io.mosn.layotto.v1.config.RuntimeProperties; +import io.mosn.layotto.v1.exceptions.RuntimeClientException; +import io.mosn.layotto.v1.grpc.GrpcRuntimeClient; +import io.mosn.layotto.v1.grpc.stub.StubManager; +import io.mosn.layotto.v1.serializer.ObjectSerializer; +import org.slf4j.Logger; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.proto.runtime.v1.RuntimeProto; +import spec.sdk.runtime.v1.domain.file.DelFileRequest; +import spec.sdk.runtime.v1.domain.file.DelFileResponse; +import spec.sdk.runtime.v1.domain.file.FileInfo; +import spec.sdk.runtime.v1.domain.file.GetFileRequest; +import spec.sdk.runtime.v1.domain.file.GetFileResponse; +import spec.sdk.runtime.v1.domain.file.GetMetaRequest; +import spec.sdk.runtime.v1.domain.file.GetMeteResponse; +import spec.sdk.runtime.v1.domain.file.ListFileRequest; +import spec.sdk.runtime.v1.domain.file.ListFileResponse; +import spec.sdk.runtime.v1.domain.file.PutFileRequest; +import spec.sdk.runtime.v1.domain.file.PutFileResponse; +import spec.sdk.runtime.v1.domain.invocation.InvokeResponse; +import spec.sdk.runtime.v1.domain.state.DeleteStateRequest; +import spec.sdk.runtime.v1.domain.state.ExecuteStateTransactionRequest; +import spec.sdk.runtime.v1.domain.state.GetBulkStateRequest; +import spec.sdk.runtime.v1.domain.state.GetStateRequest; +import spec.sdk.runtime.v1.domain.state.SaveStateRequest; +import spec.sdk.runtime.v1.domain.state.State; +import spec.sdk.runtime.v1.domain.state.StateOptions; +import spec.sdk.runtime.v1.domain.state.TransactionalStateOperation; + +import java.io.IOException; +import java.io.InputStream; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +public class RuntimeClientGrpc extends AbstractRuntimeClient implements GrpcRuntimeClient { + + private static final String TIMEOUT_KEY = "timeout"; + private final StubManager stubManager; + + RuntimeClientGrpc(Logger logger, + int timeoutMs, + ObjectSerializer stateSerializer, + StubManager stubManager) { + super(logger, timeoutMs, stateSerializer); + this.stubManager = stubManager; + } + + @Override + public String sayHello(String name, int timeoutMillisecond) { + try { + // 1. prepare request + RuntimeProto.SayHelloRequest req = RuntimeProto.SayHelloRequest.newBuilder() + .setServiceName(name) + .setName(name) + .build(); + + // 2. invoke + RuntimeProto.SayHelloResponse response = stubManager.getBlockingStub() + .withDeadlineAfter(timeoutMillisecond, + TimeUnit.MILLISECONDS) + .sayHello(req); + + // 3. parse result + return response.getHello(); + } catch (Exception e) { + logger.error("sayHello error ", e); + throw new RuntimeClientException(e); + } + } + + @Override + public InvokeResponse invokeMethod(String appId, String methodName, byte[] data, Map header, int timeoutMs) { + try { + // 1. prepare request + final ByteString byteString = ByteString.copyFrom(data); + Any anyData = Any.newBuilder() + .setValue(byteString) + .build(); + RuntimeProto.CommonInvokeRequest commonReq = RuntimeProto.CommonInvokeRequest.newBuilder() + .setMethod(methodName) + .setData(anyData) + .build(); + RuntimeProto.InvokeServiceRequest invokeReq = RuntimeProto.InvokeServiceRequest.newBuilder() + .setId(appId) + .setMessage(commonReq) + .build(); + // metadata + Metadata metadata = new Metadata(); + for (Map.Entry entry : header.entrySet()) { + if (entry.getKey() != null && entry.getValue() != null) { + Metadata.Key key = Metadata.Key.of(entry.getKey(), Metadata.ASCII_STRING_MARSHALLER); + metadata.put(key, entry.getValue()); + } + } + Metadata.Key key = Metadata.Key.of(TIMEOUT_KEY, Metadata.ASCII_STRING_MARSHALLER); + metadata.put(key, Integer.toString(timeoutMs)); + + // 2. invoke + RuntimeProto.InvokeResponse resp = this.stubManager.getBlockingStub() + .withDeadlineAfter(timeoutMs, TimeUnit.MILLISECONDS) + .withInterceptors(MetadataUtils.newAttachHeadersInterceptor(metadata)) + .invokeService(invokeReq); + + // 3. parse result + InvokeResponse result = new InvokeResponse<>(); + result.setContentType(resp.getContentType()); + byte[] bytes = new byte[]{}; + result.setData(bytes); + if (resp.getData() == null) { + return result; + } + if (resp.getData().getValue() == null) { + return result; + } + if (resp.getData().getValue().toByteArray() == null) { + return result; + } + result.setData(resp.getData().getValue().toByteArray()); + return result; + } catch (Exception e) { + logger.error("invokeMethod error ", e); + throw new RuntimeClientException(e); + } + } + + @Override + public void publishEvent(String pubsubName, String topicName, byte[] data, String contentType, + Map metadata) { + try { + // 1. prepare data + if (data == null) { + data = new byte[] {}; + } + final ByteString byteString = ByteString.copyFrom(data); + // Content-type can be overwritten on a per-request basis. + // It allows CloudEvents to be handled differently, for example. + if (contentType == null || contentType.isEmpty()) { + contentType = RuntimeProperties.DEFAULT_PUBSUB_CONTENT_TYPE; + } + + // 2. prepare request + RuntimeProto.PublishEventRequest.Builder envelopeBuilder = RuntimeProto.PublishEventRequest.newBuilder() + .setTopic(topicName) + .setPubsubName(pubsubName) + .setData(byteString) + .setDataContentType(contentType); + // metadata + if (metadata != null) { + envelopeBuilder.putAllMetadata(metadata); + } + RuntimeProto.PublishEventRequest req = envelopeBuilder.build(); + + // 3. invoke + this.stubManager.getBlockingStub().publishEvent(req); + } catch (Exception e) { + logger.error("publishEvent error ", e); + throw new RuntimeClientException(e); + } + } + + @Override + public void saveBulkState(SaveStateRequest request, int timeoutMs) { + final String stateStoreName = request.getStoreName(); + final List> states = request.getStates(); + // 1. validate + if ((stateStoreName == null) || (stateStoreName.trim().isEmpty())) { + throw new IllegalArgumentException("State store name cannot be null or empty."); + } + try { + // 2. prepare request + RuntimeProto.SaveStateRequest.Builder builder = RuntimeProto.SaveStateRequest.newBuilder(); + builder.setStoreName(stateStoreName); + for (State state : states) { + // convert request and do serialization + RuntimeProto.StateItem stateItem = buildStateRequest(state) + .build(); + builder.addStates(stateItem); + } + RuntimeProto.SaveStateRequest req = builder.build(); + // 3. invoke + this.stubManager.getBlockingStub() + .withDeadlineAfter(timeoutMs, TimeUnit.MILLISECONDS) + .saveState(req); + } catch (Exception e) { + logger.error("saveBulkState error ", e); + throw new RuntimeClientException(e); + } + } + + private RuntimeProto.StateItem.Builder buildStateRequest(State state) throws IOException { + RuntimeProto.StateItem.Builder stateBuilder = RuntimeProto.StateItem.newBuilder(); + T value = state.getValue(); + // 1. serialize value + byte[] bytes = null; + if (value != null) { + bytes = stateSerializer.serialize(value); + } + if (bytes != null) { + stateBuilder.setValue(ByteString.copyFrom(bytes)); + } + + // 2. etag + if (state.getEtag() != null) { + RuntimeProto.Etag etag = RuntimeProto.Etag.newBuilder() + .setValue(state.getEtag()) + .build(); + stateBuilder.setEtag(etag); + } + // 3. metadata + if (state.getMetadata() != null) { + stateBuilder.putAllMetadata(state.getMetadata()); + } + // 4. key + stateBuilder.setKey(state.getKey()); + // 5. StateOptions + RuntimeProto.StateOptions.Builder optionBuilder = null; + if (state.getOptions() != null) { + StateOptions options = state.getOptions(); + optionBuilder = RuntimeProto.StateOptions.newBuilder(); + if (options.getConcurrency() != null) { + RuntimeProto.StateOptions.StateConcurrency concurrency = getGrpcStateConcurrency(options); + optionBuilder.setConcurrency(concurrency); + } + if (options.getConsistency() != null) { + RuntimeProto.StateOptions.StateConsistency consistency = getGrpcStateConsistency(options); + optionBuilder.setConsistency(consistency); + } + } + if (optionBuilder != null) { + RuntimeProto.StateOptions stateOptions = optionBuilder.build(); + stateBuilder.setOptions(stateOptions); + } + + return stateBuilder; + } + + @Override + public void deleteState(DeleteStateRequest request, int timeoutMs) { + final String stateStoreName = request.getStateStoreName(); + final String key = request.getKey(); + final StateOptions options = request.getStateOptions(); + final String etag = request.getEtag(); + final Map metadata = request.getMetadata(); + + // 1. validate + if ((stateStoreName == null) || (stateStoreName.trim().isEmpty())) { + throw new IllegalArgumentException("State store name cannot be null or empty."); + } + if ((key == null) || (key.trim().isEmpty())) { + throw new IllegalArgumentException("Key cannot be null or empty."); + } + try { + // 2. prepare request + RuntimeProto.StateOptions.Builder optionBuilder = null; + if (options != null) { + optionBuilder = RuntimeProto.StateOptions.newBuilder(); + if (options.getConcurrency() != null) { + RuntimeProto.StateOptions.StateConcurrency concurrency = getGrpcStateConcurrency(options); + optionBuilder.setConcurrency(concurrency); + } + if (options.getConsistency() != null) { + RuntimeProto.StateOptions.StateConsistency consistency = getGrpcStateConsistency(options); + optionBuilder.setConsistency(consistency); + } + } + RuntimeProto.DeleteStateRequest.Builder builder = RuntimeProto.DeleteStateRequest.newBuilder() + .setStoreName(stateStoreName) + .setKey(key); + if (metadata != null) { + builder.putAllMetadata(metadata); + } + if (etag != null) { + RuntimeProto.Etag value = RuntimeProto.Etag.newBuilder() + .setValue(etag) + .build(); + builder.setEtag(value); + } + if (optionBuilder != null) { + RuntimeProto.StateOptions stateOptions = optionBuilder.build(); + builder.setOptions(stateOptions); + } + RuntimeProto.DeleteStateRequest req = builder.build(); + + // 3. invoke + this.stubManager.getBlockingStub() + .withDeadlineAfter(timeoutMs, TimeUnit.MILLISECONDS) + .deleteState(req); + } catch (Exception e) { + logger.error("deleteState error ", e); + throw new RuntimeClientException(e); + } + } + + private RuntimeProto.StateOptions.StateConcurrency getGrpcStateConcurrency(StateOptions options) { + switch (options.getConcurrency()) { + case FIRST_WRITE: + return RuntimeProto.StateOptions.StateConcurrency.CONCURRENCY_FIRST_WRITE; + case LAST_WRITE: + return RuntimeProto.StateOptions.StateConcurrency.CONCURRENCY_LAST_WRITE; + default: + throw new IllegalArgumentException("Missing StateConcurrency mapping to gRPC Concurrency enum"); + } + } + + private RuntimeProto.StateOptions.StateConsistency getGrpcStateConsistency(StateOptions options) { + switch (options.getConsistency()) { + case EVENTUAL: + return RuntimeProto.StateOptions.StateConsistency.CONSISTENCY_EVENTUAL; + case STRONG: + return RuntimeProto.StateOptions.StateConsistency.CONSISTENCY_STRONG; + default: + throw new IllegalArgumentException("Missing Consistency mapping to gRPC Consistency enum"); + } + } + + /** + * Execute a transaction. + * + * @param request Request to execute transaction. + */ + @Override + public void executeStateTransaction(ExecuteStateTransactionRequest request) { + final String stateStoreName = request.getStateStoreName(); + final List> operations = request.getOperations(); + final Map metadata = request.getMetadata(); + + // 1. validate + assertTrue(stateStoreName != null && !stateStoreName.trim().isEmpty(), + "stateStoreName cannot be null or empty."); + assertTrue(operations != null && !operations.isEmpty(), "operations cannot be null or empty."); + try { + // 2. construct request object + RuntimeProto.ExecuteStateTransactionRequest.Builder builder = RuntimeProto.ExecuteStateTransactionRequest + .newBuilder(); + builder.setStoreName(stateStoreName); + if (metadata != null) { + builder.putAllMetadata(metadata); + } + for (TransactionalStateOperation op : operations) { + // validate each operation + assertTrue(op.getOperation() != null, "operation cannot be null."); + State req = op.getRequest(); + assertTrue(req != null, "request cannot be null."); + String k = req.getKey(); + assertTrue(k != null && !k.isEmpty(), "request cannot be null."); + + // build grpc request + RuntimeProto.TransactionalStateOperation.Builder operationBuilder = RuntimeProto.TransactionalStateOperation + .newBuilder(); + String operationType = op.getOperation().toString().toLowerCase(); + operationBuilder.setOperationType(operationType); + + // convert request and do serialization + RuntimeProto.StateItem stateItem = buildStateRequest(req) + .build(); + operationBuilder.setRequest(stateItem); + + builder.addOperations(operationBuilder.build()); + } + RuntimeProto.ExecuteStateTransactionRequest req = builder.build(); + + // 3. invoke grpc api + this.stubManager.getBlockingStub().executeStateTransaction(req); + } catch (IllegalArgumentException e) { + logger.error("executeStateTransaction error ", e); + throw e; + } catch (Exception e) { + logger.error("executeStateTransaction error ", e); + throw new RuntimeClientException(e); + } + } + + private void assertTrue(boolean argumentAssertion, String errMsg) { + if (!argumentAssertion) { + throw new IllegalArgumentException(errMsg); + } + } + + @Override + protected State doGetState(GetStateRequest request, int timeoutMs) { + // 1. extract fields. + final String stateStoreName = request.getStoreName(); + final String key = request.getKey(); + final StateOptions options = request.getStateOptions(); + final Map metadata = request.getMetadata(); + try { + // 2. construct request object + RuntimeProto.GetStateRequest.Builder builder = RuntimeProto.GetStateRequest.newBuilder() + .setStoreName(stateStoreName) + .setKey(key); + if (metadata != null) { + builder.putAllMetadata(metadata); + } + if (options != null && options.getConsistency() != null) { + RuntimeProto.StateOptions.StateConsistency consistency = getGrpcStateConsistency(options); + builder.setConsistency(consistency); + } + RuntimeProto.GetStateRequest envelope = builder.build(); + + // 3. invoke grpc api + RuntimeGrpc.RuntimeBlockingStub stub = this.stubManager.getBlockingStub(); + if (timeoutMs > 0) { + stub = stub.withDeadlineAfter(timeoutMs, TimeUnit.MILLISECONDS); + } + RuntimeProto.GetStateResponse getStateResponse = stub.getState(envelope); + + // 4. parse result + // value + final ByteString payload = getStateResponse.getData(); + byte[] value = payload == null ? null : payload.toByteArray(); + // etag + String etag = getStateResponse.getEtag(); + if (etag != null && etag.isEmpty()) { + etag = null; + } + return new State<>(key, value, etag, getStateResponse.getMetadataMap(), options); + } catch (Exception e) { + logger.error("getState error ", e); + throw new RuntimeClientException(e); + } + } + + @Override + protected List> doGetBulkState(GetBulkStateRequest request, int timeoutMs) { + // 1. extract fields + final String stateStoreName = request.getStoreName(); + final List keys = request.getKeys(); + final int parallelism = request.getParallelism(); + final Map metadata = request.getMetadata(); + + try { + // 2. construct request object + RuntimeProto.GetBulkStateRequest.Builder builder = RuntimeProto.GetBulkStateRequest.newBuilder() + .setStoreName(stateStoreName) + .addAllKeys(keys) + .setParallelism(parallelism); + if (metadata != null) { + builder.putAllMetadata(metadata); + } + RuntimeProto.GetBulkStateRequest envelope = builder.build(); + + // 3. invoke grpc API + RuntimeGrpc.RuntimeBlockingStub stub = this.stubManager.getBlockingStub(); + if (timeoutMs > 0) { + stub = stub.withDeadlineAfter(timeoutMs, TimeUnit.MILLISECONDS); + } + RuntimeProto.GetBulkStateResponse resp = stub.getBulkState(envelope); + + // 4. parse result + List itemsList = resp.getItemsList(); + List> result = new ArrayList<>(itemsList.size()); + for (RuntimeProto.BulkStateItem itm : itemsList) { + State tState = parseGetStateResult(itm); + result.add(tState); + } + return result; + } catch (Exception e) { + logger.error("getBulkState error ", e); + throw new RuntimeClientException(e); + } + } + + private State parseGetStateResult(RuntimeProto.BulkStateItem bulkStateItem) throws IOException { + final String key = bulkStateItem.getKey(); + // check error + final String error = bulkStateItem.getError(); + if (!Strings.isNullOrEmpty(error)) { + return new State<>(key, error); + } + // value + final ByteString payload = bulkStateItem.getData(); + byte[] value = payload == null ? null : payload.toByteArray(); + // etag + String etag = bulkStateItem.getEtag(); + if (etag != null && etag.isEmpty()) { + etag = null; + } + return new State<>(key, value, etag, bulkStateItem.getMetadataMap(), null); + } + + /** + * Getter method for property stubManager. + * + * Do not use it ! + * This method is deprecated and might be refactored in the future. + * We want this client to expose grpc Channels instead of grpc stubs. + * + * @return property value of stubManager + */ + @Deprecated + @Override + public StubManager getStubManager() { + return stubManager; + } + + @Override + public void shutdown() { + stubManager.destroy(); + } + + @Override + public PutFileResponse putFile(PutFileRequest request, int timeoutMs) throws Exception { + + checkParamOfPutFile(request); + + PutFileFuture putFuture = new PutFileFuture(request.getFileName()); + StreamObserver observer = createPutFileObserver(putFuture, timeoutMs); + + observer.onNext(buildPutFileMetaDataRequest(request.getStoreName(), request.getFileName(), + request.getMetaData())); + + byte[] buf = new byte[4096]; + for (int size = request.getIn().read(buf); size > 0; size = request.getIn().read(buf)) { + observer.onNext(buildPutFileDataRequest(buf, size)); + } + + observer.onCompleted(); + + putFuture.awaitDone(timeoutMs); + + return new PutFileResponse(); + } + + @Override + public GetFileResponse getFile(GetFileRequest request, int timeoutMs) throws Exception { + + checkParamOfGetFile(request); + + GetFilePipe pipe = new GetFilePipe(request.getFileName()); + + stubManager. + getAsyncStub(). + getFile( + buildGetFileRequest( + request.getStoreName(), + request.getFileName(), + request.getMetaData()), + pipe); + + return new GetFileResponse(pipe.getReader()); + } + + @Override + public ListFileResponse listFile(ListFileRequest request, int timeoutMs) throws Exception { + + checkParamOfListFile(request); + + RuntimeProto.ListFileResp response = stubManager. + getBlockingStub(). + withDeadlineAfter(timeoutMs, TimeUnit.MILLISECONDS). + listFile( + buildListFileRequest( + request.getStoreName(), + request.getName(), + request.getMarker(), + request.getPageSize(), + request.getMetaData())); + + return buildListFileResponse(response); + } + + @Override + public DelFileResponse delFile(DelFileRequest request, int timeoutMs) throws Exception { + + checkParamOfDeleteFile(request); + + stubManager. + getBlockingStub(). + withDeadlineAfter(timeoutMs, TimeUnit.MILLISECONDS). + delFile( + buildDelFileRequest(request.getStoreName(), request.getFileName(), request.getMetaData())); + + return new DelFileResponse(); + } + + @Override + public GetMeteResponse getFileMeta(GetMetaRequest request, int timeoutMs) throws Exception { + + checkParamOfGetFileMeta(request); + + RuntimeProto.GetFileMetaResponse resp = stubManager. + getBlockingStub(). + withDeadlineAfter(timeoutMs, TimeUnit.MILLISECONDS). + getFileMeta( + buildGetFileMetaRequest(request.getStoreName(), request.getFileName(), request.getMetaData())); + + return buildGetFileMetaResponse(resp); + } + + private void checkParamOfGetFile(GetFileRequest request) { + + // check request + if (request == null) { + throw new IllegalArgumentException("miss request"); + } + + // check store name + if (request.getStoreName() == null) { + throw new IllegalArgumentException("miss store name"); + } + + // check file name + if (request.getFileName() == null) { + throw new IllegalArgumentException("miss file name"); + } + } + + private void checkParamOfPutFile(PutFileRequest request) { + + // check request + if (request == null) { + throw new IllegalArgumentException("miss request"); + } + + // check store name + if (request.getStoreName() == null) { + throw new IllegalArgumentException("miss store name"); + } + + // check file name + if (request.getFileName() == null) { + throw new IllegalArgumentException("miss file name"); + } + + // check input stream + if (request.getIn() == null) { + throw new IllegalArgumentException("miss file stream"); + } + } + + private void checkParamOfListFile(ListFileRequest request) { + + // check request + if (request == null) { + throw new IllegalArgumentException("miss request"); + } + + // check store name + if (request.getStoreName() == null) { + throw new IllegalArgumentException("miss store name"); + } + } + + private void checkParamOfDeleteFile(DelFileRequest request) { + + // check request + if (request == null) { + throw new IllegalArgumentException("miss request"); + } + + // check file name + if (request.getFileName() == null) { + throw new IllegalArgumentException("miss file name"); + } + + // check store name + if (request.getStoreName() == null) { + throw new IllegalArgumentException("miss store name"); + } + } + + private void checkParamOfGetFileMeta(GetMetaRequest request) { + + // check request + if (request == null) { + throw new IllegalArgumentException("miss request"); + } + + // check store name + if (request.getStoreName() == null) { + throw new IllegalArgumentException("miss store name"); + } + + // check file name + if (request.getFileName() == null) { + throw new IllegalArgumentException("miss file name"); + } + } + + private class PutFileFuture implements StreamObserver { + + private final String fileName; + private final CountDownLatch latch; + + private volatile Throwable t; + + PutFileFuture(String fileName) { + this.fileName = fileName; + this.latch = new CountDownLatch(1); + } + + @Override + public void onNext(Empty value) { + logger.info(String.format("put File %s successfully", this.fileName)); + } + + @Override + public void onError(Throwable t) { + logger.error(String.format("put File error, file=%s", this.fileName), t); + this.t = t; + this.latch.countDown(); + } + + @Override + public void onCompleted() { + logger.info(String.format("put File %s complete", this.fileName)); + latch.countDown(); + } + + public void awaitDone(int timeoutMs) throws Exception { + + boolean finished = latch.await(timeoutMs, TimeUnit.MILLISECONDS); + if (!finished) { + String tip = String.format("put file timeout, file=%s", fileName); + throw new RuntimeClientException("PUT_FILE", tip); + } + + // do not wrap for grpc Exception + if (t instanceof StatusRuntimeException) { + throw (StatusRuntimeException) t; + } + + // wrap exception for non grpc Exception + if (t != null) { + throw new RuntimeClientException(t); + } + } + } + + private class PipeFileInputStream extends PipedInputStream { + + private volatile Throwable cause; + + PipeFileInputStream(PipedOutputStream out) throws IOException { + super(out); + } + + @Override + public synchronized int read() throws IOException { + + checkCause(); + + return super.read(); + } + + @Override + public int read(byte[] b) throws IOException { + + checkCause(); + + return super.read(b); + } + + @Override + public synchronized int read(byte[] b, int off, int len) throws IOException { + + checkCause(); + + return super.read(b, off, len); + } + + private void checkCause() throws IOException { + if (this.cause != null) { + this.close(); + throw new IOException(this.cause); + } + } + + public void setCause(Throwable cause) { + this.cause = cause; + } + } + + private class GetFilePipe implements StreamObserver { + + private final String fileName; + private final PipeFileInputStream reader; + private final PipedOutputStream dataSource; + + GetFilePipe(String fileName) throws IOException { + this.fileName = fileName; + this.dataSource = new PipedOutputStream(); + this.reader = new PipeFileInputStream(this.dataSource); + } + + @Override + public void onNext(RuntimeProto.GetFileResponse value) { + + logger.info(String.format("get File %s successfully", this.fileName)); + + pipe(value.getData().toByteArray()); + } + + @Override + public void onError(Throwable t) { + + logger.error(String.format("get File error, file=%s", this.fileName), t); + + reader.setCause(t); + + pipe(t.getMessage().getBytes()); + } + + @Override + public void onCompleted() { + + logger.info(String.format("get File %s complete", this.fileName)); + + close(); + } + + private void pipe(byte[] data) { + try { + dataSource.write(data); + } catch (IOException e) { + logger.error("get File transform err", e); + } + } + + private void close() { + try { + dataSource.close(); + } catch (IOException e) { + logger.error("get File close stream err", e); + } + } + + public InputStream getReader() { + return this.reader; + } + } + + private StreamObserver createPutFileObserver( + StreamObserver callBackObserver, + int timeoutMs) { + + return stubManager. + getAsyncStub(). + withDeadlineAfter(timeoutMs, TimeUnit.MILLISECONDS). + putFile(callBackObserver); + } + + private RuntimeProto.PutFileRequest buildPutFileMetaDataRequest(String storeName, + String fileName, + Map meta) { + return RuntimeProto.PutFileRequest. + newBuilder(). + setStoreName(storeName). + setName(fileName). + putAllMetadata(meta). + build(); + } + + private RuntimeProto.PutFileRequest buildPutFileDataRequest(byte[] bytes, int size) { + + return RuntimeProto.PutFileRequest. + newBuilder(). + setData(ByteString.copyFrom(bytes, 0, size)). + build(); + } + + private RuntimeProto.GetFileRequest buildGetFileRequest(String storeName, + String fileName, + Map meta) { + + return RuntimeProto.GetFileRequest. + newBuilder(). + setStoreName(storeName). + setName(fileName). + putAllMetadata(meta). + build(); + } + + private RuntimeProto.ListFileRequest buildListFileRequest(String storeName, String name, String marker, + int pageSize, Map meta) { + + RuntimeProto.FileRequest fileRequest = RuntimeProto.FileRequest. + newBuilder(). + setStoreName(storeName). + setName(name). + putAllMetadata(meta). + build(); + + return RuntimeProto.ListFileRequest. + newBuilder(). + setRequest(fileRequest). + setMarker(marker). + setPageSize(pageSize). + build(); + } + + private RuntimeProto.DelFileRequest buildDelFileRequest(String storeName, + String fileName, + Map meta) { + + RuntimeProto.FileRequest fileRequest = RuntimeProto.FileRequest. + newBuilder(). + setStoreName(storeName). + setName(fileName). + putAllMetadata(meta). + build(); + + return RuntimeProto.DelFileRequest. + newBuilder(). + setRequest(fileRequest). + build(); + } + + private RuntimeProto.GetFileMetaRequest buildGetFileMetaRequest(String storeName, + String fileName, + Map meta) { + + RuntimeProto.FileRequest fileRequest = RuntimeProto.FileRequest. + newBuilder(). + setStoreName(storeName). + setName(fileName). + putAllMetadata(meta). + build(); + + return RuntimeProto.GetFileMetaRequest. + newBuilder(). + setRequest(fileRequest). + build(); + } + + private GetMeteResponse buildGetFileMetaResponse(RuntimeProto.GetFileMetaResponse resp) { + + Map metas = new HashMap<>(); + resp.getResponse(). + getMetadataMap(). + forEach( + (s, fileMetaValue) -> + metas.put(s, fileMetaValue.getValueList().toArray(new String[0]))); + + GetMeteResponse result = new GetMeteResponse(); + result.setSize(resp.getSize()); + result.setLastModified(resp.getLastModified()); + result.setMeta(metas); + + return result; + } + + private ListFileResponse buildListFileResponse(RuntimeProto.ListFileResp resp) { + + FileInfo[] files = resp.getFilesList(). + stream(). + map( + fileInfo -> + new FileInfo( + fileInfo.getFileName(), + fileInfo.getSize(), + fileInfo.getLastModified(), + fileInfo.getMetadataMap())). + toArray(FileInfo[]::new); + + ListFileResponse result = new ListFileResponse(); + result.setFiles(files); + result.setTruncated(resp.getIsTruncated()); + result.setMarker(resp.getMarker()); + + return result; + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/RuntimeServerGrpc.java b/sdk/src/main/java/io/mosn/layotto/v1/RuntimeServerGrpc.java new file mode 100644 index 0000000..6409d10 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/RuntimeServerGrpc.java @@ -0,0 +1,105 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.mosn.layotto.v1.callback.GrpcAppCallbackImpl; +import io.mosn.layotto.v1.callback.component.pubsub.Subscriber; +import io.mosn.layotto.v1.callback.component.pubsub.SubscriberRegistry; +import io.mosn.layotto.v1.callback.component.pubsub.SubscriberRegistryImpl; +import io.mosn.layotto.v1.grpc.ExceptionHandler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; + +public class RuntimeServerGrpc { + + private static final Logger logger = LoggerFactory.getLogger(RuntimeServerGrpc.class.getName()); + + private final int port; + private volatile Server server; + private final AtomicBoolean started = new AtomicBoolean(false); + + public RuntimeServerGrpc(int port) { + this.port = port; + } + + private final SubscriberRegistry subscriberRegistry = new SubscriberRegistryImpl(); + + public void start() throws IOException { + // 1 make sure at most once + if (!started.compareAndSet(false, true)) { + return; + } + // 2 start grpc server + try { + /* The port on which the server should run */ + server = ServerBuilder.forPort(port) + .addService(new GrpcAppCallbackImpl(subscriberRegistry)) + .intercept(new ExceptionHandler()) + .build() + .start(); + } catch (Exception e) { + // revert + server = null; + started.set(false); + throw e; + } + logger.info("Server started, listening on {}", port); + + // 3 addShutdownHook + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { + // Use stderr here since the logger may have been reset by its JVM shutdown hook. + logger.info("*** shutting down gRPC server since JVM is shutting down"); + try { + RuntimeServerGrpc.this.stop(); + } catch (Exception e) { + logger.error("*** server shut down error", e); + } + } + }); + } + + public void stop() throws InterruptedException { + Server srv = this.server; + if (srv != null) { + srv.shutdown().awaitTermination(30, TimeUnit.SECONDS); + } + } + + /** + * Await termination on the main thread since the grpc library uses daemon threads. + */ + public void blockUntilShutdown() throws InterruptedException { + Server srv = this.server; + if (srv != null) { + srv.awaitTermination(); + } + } + + public SubscriberRegistry getPubSubRegistry() { + return subscriberRegistry; + } + + public void registerPubSubCallback(String pubsubName, Subscriber callback) { + subscriberRegistry.registerPubSubCallback(pubsubName, callback); + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/callback/GrpcAppCallbackImpl.java b/sdk/src/main/java/io/mosn/layotto/v1/callback/GrpcAppCallbackImpl.java new file mode 100644 index 0000000..3254c0d --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/callback/GrpcAppCallbackImpl.java @@ -0,0 +1,87 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.callback; + +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import io.mosn.layotto.v1.callback.component.pubsub.Subscriber; +import io.mosn.layotto.v1.callback.component.pubsub.SubscriberRegistry; +import io.mosn.layotto.v1.grpc.PubsubConverter; +import spec.proto.runtime.v1.AppCallbackGrpc; +import spec.proto.runtime.v1.AppCallbackProto; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventResponse; +import spec.sdk.runtime.v1.domain.pubsub.TopicSubscription; + +import java.util.Collection; +import java.util.Set; + +public class GrpcAppCallbackImpl extends AppCallbackGrpc.AppCallbackImplBase { + + private final SubscriberRegistry subscriberRegistry; + + public GrpcAppCallbackImpl(SubscriberRegistry subscriberRegistry) { + this.subscriberRegistry = subscriberRegistry; + } + + /** + * Iterates all pubsub clients registered to pubSubClientRegistry and get all topic subscriptions. + */ + @Override + public void listTopicSubscriptions(Empty request, + StreamObserver responseObserver) { + final AppCallbackProto.ListTopicSubscriptionsResponse.Builder builder = AppCallbackProto.ListTopicSubscriptionsResponse + .newBuilder(); + // get all PubSub callbacks + Collection pubsubs = subscriberRegistry.getAllPubSubCallbacks(); + if (pubsubs == null) { + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + return; + } + // Iterates them and get all topic subscriptions. + for (Subscriber subscriber : pubsubs) { + final Set topicSubscriptions = subscriber.listTopicSubscriptions(); + if (topicSubscriptions == null || topicSubscriptions.isEmpty()) { + continue; + } + for (TopicSubscription topicSubscription : topicSubscriptions) { + if (topicSubscription == null) { + continue; + } + builder.addSubscriptions(PubsubConverter.TopicSubscription2Grpc(topicSubscription)); + } + } + + // ack + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + } + + /** + * On message delivery, find pubsub client by pubsub name. + */ + @Override + public void onTopicEvent(AppCallbackProto.TopicEventRequest request, + StreamObserver responseObserver) { + final String pubsubName = request.getPubsubName(); + // dispatch by pub sub name + final Subscriber pubsub = subscriberRegistry.getCallbackByPubSubName(pubsubName); + + // invoke callback + final TopicEventResponse response = pubsub.onTopicEvent(PubsubConverter.TopicEventRequest2Domain(request)); + responseObserver.onNext(PubsubConverter.TopicEventResponse2Grpc(response)); + responseObserver.onCompleted(); + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/callback/component/Component.java b/sdk/src/main/java/io/mosn/layotto/v1/callback/component/Component.java new file mode 100644 index 0000000..f105e03 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/callback/component/Component.java @@ -0,0 +1,20 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.callback.component; + +public interface Component { + + String getComponentName(); +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/callback/component/pubsub/Subscriber.java b/sdk/src/main/java/io/mosn/layotto/v1/callback/component/pubsub/Subscriber.java new file mode 100644 index 0000000..21e683d --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/callback/component/pubsub/Subscriber.java @@ -0,0 +1,32 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.callback.component.pubsub; + +import io.mosn.layotto.v1.callback.component.Component; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventRequest; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventResponse; +import spec.sdk.runtime.v1.domain.pubsub.TopicSubscription; + +import java.util.Set; + +/** + * Subscriber component + */ +public interface Subscriber extends Component { + + Set listTopicSubscriptions(); + + TopicEventResponse onTopicEvent(TopicEventRequest request); +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/callback/component/pubsub/SubscriberRegistry.java b/sdk/src/main/java/io/mosn/layotto/v1/callback/component/pubsub/SubscriberRegistry.java new file mode 100644 index 0000000..aaa36be --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/callback/component/pubsub/SubscriberRegistry.java @@ -0,0 +1,26 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.callback.component.pubsub; + +import java.util.Collection; + +public interface SubscriberRegistry { + + void registerPubSubCallback(String pubsubName, Subscriber callback); + + Subscriber getCallbackByPubSubName(String pubSubName); + + Collection getAllPubSubCallbacks(); +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/callback/component/pubsub/SubscriberRegistryImpl.java b/sdk/src/main/java/io/mosn/layotto/v1/callback/component/pubsub/SubscriberRegistryImpl.java new file mode 100644 index 0000000..155995b --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/callback/component/pubsub/SubscriberRegistryImpl.java @@ -0,0 +1,55 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.callback.component.pubsub; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class SubscriberRegistryImpl implements SubscriberRegistry { + + public final Map pubSubClients = new ConcurrentHashMap<>(); + + @Override + public void registerPubSubCallback(String pubsubName, Subscriber callback) { + if (pubsubName == null) { + throw new IllegalArgumentException("pubSubName shouldn't be null"); + } + if (callback == null) { + throw new IllegalArgumentException("callback shouldn't be null"); + } + if (pubSubClients.putIfAbsent(pubsubName, callback) != null) { + throw new IllegalArgumentException("Pub/sub callback with name " + pubsubName + " already exists!"); + } + } + + @Override + public Subscriber getCallbackByPubSubName(String pubsubName) { + if (pubsubName == null) { + throw new IllegalArgumentException("pubsubName shouldn't be null"); + } + final Subscriber subscriber = pubSubClients.get(pubsubName); + if (subscriber == null) { + throw new IllegalArgumentException("Cannot find pubsub callback by name " + pubsubName); + } + return subscriber; + } + + @Override + public Collection getAllPubSubCallbacks() { + return new HashSet<>(pubSubClients.values()); + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/config/RuntimeProperties.java b/sdk/src/main/java/io/mosn/layotto/v1/config/RuntimeProperties.java new file mode 100644 index 0000000..4f09bad --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/config/RuntimeProperties.java @@ -0,0 +1,46 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.config; + +import io.mosn.layotto.v1.domain.ApiProtocol; + +public class RuntimeProperties { + + /** + * Layotto Runtimes default use of GRPC. + */ + public static final ApiProtocol DEFAULT_API_PROTOCOL = ApiProtocol.GRPC; + + /** + * Layotto Runtimes default start on "127.0.0.1". + */ + public static final String DEFAULT_IP = "127.0.0.1"; + + /** + * Layotto Runtimes default start on 34904 port. + */ + public static final Integer DEFAULT_PORT = 34904; + + /** + * Layotto Runtimes default timeout in 1000ms for GRPC client reads. + */ + public static final Integer DEFAULT_TIMEOUT_MS = 3000; + + /** + * Layotto Runtimes default pubsub content type. + */ + public static final String DEFAULT_PUBSUB_CONTENT_TYPE = ""; + +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/domain/ApiProtocol.java b/sdk/src/main/java/io/mosn/layotto/v1/domain/ApiProtocol.java new file mode 100644 index 0000000..a194d33 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/domain/ApiProtocol.java @@ -0,0 +1,25 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.domain; + +/** + * Transport protocol for Runtime API. + */ +public enum ApiProtocol { + + GRPC, + // currently not supported + // HTTP +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/exceptions/RuntimeClientException.java b/sdk/src/main/java/io/mosn/layotto/v1/exceptions/RuntimeClientException.java new file mode 100644 index 0000000..92ebf6b --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/exceptions/RuntimeClientException.java @@ -0,0 +1,95 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.exceptions; + +/** + * A Runtime's specific exception. + */ +public class RuntimeClientException extends RuntimeException { + + /** + * Runtime's error code for this exception. + */ + private final String errorCode; + + /** + * New exception from a server-side generated error code and message. + * + * @param runtimeError Server-side error. + */ + public RuntimeClientException(RuntimeError runtimeError) { + this(runtimeError.getErrorCode(), runtimeError.getMessage()); + } + + /** + * New exception from a server-side generated error code and message. + * + * @param runtimeError Client-side error. + * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is + * permitted, and indicates that the cause is nonexistent or unknown.) + */ + public RuntimeClientException(RuntimeError runtimeError, Throwable cause) { + this(runtimeError.getErrorCode(), runtimeError.getMessage(), cause); + } + + /** + * Wraps an exception into a RuntimeException. + * + * @param exception the exception to be wrapped. + */ + public RuntimeClientException(Throwable exception) { + this("UNKNOWN", exception.getMessage(), exception); + } + + /** + * New Exception from a client-side generated error code and message. + * + * @param errorCode Client-side error code. + * @param message Client-side error message. + */ + public RuntimeClientException(String errorCode, String message) { + super(String.format("%s: %s", errorCode, message)); + this.errorCode = errorCode; + } + + /** + * New exception from a server-side generated error code and message. + * + * @param errorCode Client-side error code. + * @param message Client-side error message. + * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method). (A {@code null} value is + * permitted, and indicates that the cause is nonexistent or unknown.) + */ + public RuntimeClientException(String errorCode, String message, Throwable cause) { + super(String.format("%s: %s", errorCode, emptyIfNull(message)), cause); + this.errorCode = errorCode; + } + + /** + * Returns the exception's error code. + * + * @return Error code. + */ + public String getErrorCode() { + return this.errorCode; + } + + private static String emptyIfNull(String str) { + if (str == null) { + return ""; + } + return str; + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/exceptions/RuntimeError.java b/sdk/src/main/java/io/mosn/layotto/v1/exceptions/RuntimeError.java new file mode 100644 index 0000000..ff2fe00 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/exceptions/RuntimeError.java @@ -0,0 +1,47 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.exceptions; + +public enum RuntimeError { + ; + + /** + * Error code. + */ + private String errorCode; + + /** + * Error Message. + */ + private String message; + + /** + * Getter method for property errorCode. + * + * @return property value of errorCode + */ + public String getErrorCode() { + return errorCode; + } + + /** + * Getter method for property message. + * + * @return property value of message + */ + public String getMessage() { + return message; + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/grpc/ExceptionHandler.java b/sdk/src/main/java/io/mosn/layotto/v1/grpc/ExceptionHandler.java new file mode 100644 index 0000000..2307819 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/grpc/ExceptionHandler.java @@ -0,0 +1,74 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.grpc; + +import io.grpc.ForwardingServerCallListener; +import io.grpc.Metadata; +import io.grpc.ServerCall; +import io.grpc.ServerCallHandler; +import io.grpc.ServerInterceptor; +import io.grpc.Status; + +public class ExceptionHandler implements ServerInterceptor { + + @Override + public ServerCall.Listener interceptCall(ServerCall serverCall, Metadata metadata, + ServerCallHandler serverCallHandler) { + ServerCall.Listener listener = serverCallHandler.startCall(serverCall, metadata); + return new ExceptionHandlingServerCallListener<>(listener, serverCall, metadata); + } + + private class ExceptionHandlingServerCallListener + extends + ForwardingServerCallListener.SimpleForwardingServerCallListener { + private ServerCall serverCall; + private Metadata metadata; + + ExceptionHandlingServerCallListener(ServerCall.Listener listener, ServerCall serverCall, + Metadata metadata) { + super(listener); + this.serverCall = serverCall; + this.metadata = metadata; + } + + @Override + public void onHalfClose() { + try { + super.onHalfClose(); + } catch (RuntimeException ex) { + handleException(ex, serverCall, metadata); + throw ex; + } + } + + @Override + public void onReady() { + try { + super.onReady(); + } catch (RuntimeException ex) { + handleException(ex, serverCall, metadata); + throw ex; + } + } + + private void handleException(RuntimeException exception, ServerCall serverCall, Metadata metadata) { + if (exception instanceof IllegalArgumentException) { + serverCall.close(Status.INVALID_ARGUMENT.withDescription(exception.getMessage()), metadata); + } else { + serverCall.close(Status.INTERNAL.withCause(exception), metadata); + } + } + } +} \ No newline at end of file diff --git a/sdk/src/main/java/io/mosn/layotto/v1/grpc/GrpcRuntimeClient.java b/sdk/src/main/java/io/mosn/layotto/v1/grpc/GrpcRuntimeClient.java new file mode 100644 index 0000000..38c3d7e --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/grpc/GrpcRuntimeClient.java @@ -0,0 +1,34 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.grpc; + +import io.mosn.layotto.v1.grpc.stub.StubManager; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.sdk.runtime.v1.client.RuntimeClient; + +public interface GrpcRuntimeClient extends RuntimeClient { + + /** + * Getter method for property stubManager. + * + * Do not use it ! + * This method is deprecated and might be refactored in the future. + * We want this client to expose grpc Channels instead of grpc stubs. + * + * @return property value of stubManager + */ + @Deprecated + StubManager getStubManager(); +} \ No newline at end of file diff --git a/sdk/src/main/java/io/mosn/layotto/v1/grpc/PubsubConverter.java b/sdk/src/main/java/io/mosn/layotto/v1/grpc/PubsubConverter.java new file mode 100644 index 0000000..320cc44 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/grpc/PubsubConverter.java @@ -0,0 +1,112 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.grpc; + +import com.google.protobuf.ByteString; +import spec.proto.runtime.v1.AppCallbackProto; +import spec.proto.runtime.v1.RuntimeProto; +import spec.sdk.runtime.v1.domain.pubsub.PublishEventRequest; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventRequest; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventResponse; +import spec.sdk.runtime.v1.domain.pubsub.TopicSubscription; + +/** + * pubsub related converter + */ +public class PubsubConverter { + + public static RuntimeProto.PublishEventRequest PublishEventRequest2Grpc(PublishEventRequest req) { + if (req == null) { + return null; + } + RuntimeProto.PublishEventRequest.Builder builder = RuntimeProto.PublishEventRequest.newBuilder() + .setPubsubName(req.getPubsubName()) + .setTopic(req.getTopic()) + .setData(ByteString.copyFrom(req.getData())) + .setDataContentType(req.getContentType()); + if (req.getMetadata() != null) { + builder.putAllMetadata(req.getMetadata()); + } + return builder.build(); + } + + public static AppCallbackProto.TopicSubscription TopicSubscription2Grpc(TopicSubscription sub) { + if (sub == null) { + return null; + } + AppCallbackProto.TopicSubscription.Builder builder = AppCallbackProto.TopicSubscription.newBuilder() + .setPubsubName(sub.getPubsubName()) + .setTopic(sub.getTopic()); + if (sub.getMetadata() != null) { + builder.putAllMetadata(sub.getMetadata()); + } + return builder.build(); + } + + public static AppCallbackProto.TopicEventResponse TopicEventResponse2Grpc(TopicEventResponse resp) { + if (resp == null) { + return null; + } + int idx = 0; + if (resp.getStatus() != null) { + idx = resp.getStatus().getIdx(); + } + AppCallbackProto.TopicEventResponse result = AppCallbackProto.TopicEventResponse.newBuilder() + .setStatusValue(idx) + .build(); + return result; + } + + public static AppCallbackProto.TopicEventRequest TopicEventRequest2Grpc(TopicEventRequest req) { + if (req == null) { + return null; + } + AppCallbackProto.TopicEventRequest.Builder builder = AppCallbackProto.TopicEventRequest.newBuilder() + .setId(req.getId()) + .setSource(req.getSource()) + .setType(req.getType()) + .setSpecVersion(req.getSpecVersion()) + .setDataContentType(req.getContentType()) + .setTopic(req.getTopic()) + .setPubsubName(req.getPubsubName()); + //.putAllMetadata(req.getMetadata()) + byte[] bytes = req.getData(); + if (bytes == null) { + bytes = new byte[] {}; + } + builder.setData(ByteString.copyFrom(bytes)); + return builder.build(); + } + + public static TopicEventRequest TopicEventRequest2Domain(AppCallbackProto.TopicEventRequest req) { + TopicEventRequest result = new TopicEventRequest(); + result.setId(req.getId()); + result.setSource(req.getSource()); + result.setType(req.getType()); + result.setSpecVersion(req.getSpecVersion()); + result.setContentType(req.getDataContentType()); + result.setMetadata(req.getMetadataMap()); + ByteString byteString = req.getData(); + if (byteString == null) { + result.setData(new byte[] {}); + } else { + result.setData(byteString.toByteArray()); + } + result.setTopic(req.getTopic()); + result.setPubsubName(req.getPubsubName()); + //result.setMetadata(req.getMetadataMap()); + return result; + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/PooledStubManager.java b/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/PooledStubManager.java new file mode 100644 index 0000000..2eed193 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/PooledStubManager.java @@ -0,0 +1,135 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.grpc.stub; + +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.grpc.stub.AbstractAsyncStub; +import io.grpc.stub.AbstractBlockingStub; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; + +public class PooledStubManager + implements + StubManager { + + private volatile ManagedChannel[] channels; + private final RRPool asyncRuntimePool; + private final RRPool runtimePool; + + public PooledStubManager(ManagedChannel[] channels, + StubCreator sc) { + // 1. validate + if (channels.length == 0) { + throw new IllegalArgumentException("Invalid other"); + } + if (sc == null) { + throw new IllegalArgumentException("Invalid StubCreator"); + } + // 2. construct + ConstructResult result = constructPools(channels, sc); + this.asyncRuntimePool = result.asyncPool; + this.runtimePool = result.blockingPool; + // 3. init + init(result.asyncStubs, result.blockingStubs); + } + + private static class ConstructResult { + List asyncStubs; + List blockingStubs; + RRPool asyncPool; + RRPool blockingPool; + + public ConstructResult(List asyncStubs, List blockingStubs, RRPool asyncPool, RRPool blockingPool) { + this.asyncStubs = asyncStubs; + this.blockingStubs = blockingStubs; + this.asyncPool = asyncPool; + this.blockingPool = blockingPool; + } + } + + private ConstructResult constructPools(ManagedChannel[] channels, StubCreator sc) { + int size = channels.length; + this.channels = new ManagedChannel[size]; + List asyncStubs = new ArrayList<>(); + List blockingStubs = new ArrayList<>(); + // 1. construct channels and stubs + for (int i = 0; i < size; i++) { + // change the order of channels to avoid unbalanced load + this.channels[i] = channels[size - 1 - i]; + asyncStubs.add(sc.createAsyncStub(channels[i])); + blockingStubs.add(sc.createBlockingStub(channels[i])); + } + // 2. construct pools + RRPool asyncPool = new RRPool<>(new CopyOnWriteArrayList<>(asyncStubs)); + RRPool blockingPool = new RRPool<>(new CopyOnWriteArrayList<>(blockingStubs)); + // 3. return + return new ConstructResult<>(asyncStubs, blockingStubs, asyncPool, blockingPool); + } + + public PooledStubManager(String host, int port, int size, + StubCreator sc) { + channels = new ManagedChannel[size]; + List asyncStubs = new ArrayList<>(); + List blockingStubs = new ArrayList<>(); + // construct channels and stubs + for (int i = 0; i < size; i++) { + channels[i] = ManagedChannelBuilder.forAddress(host, port).usePlaintext().build(); + asyncStubs.add(sc.createAsyncStub(channels[i])); + blockingStubs.add(sc.createBlockingStub(channels[i])); + } + // construct pools + asyncRuntimePool = new RRPool<>(new CopyOnWriteArrayList<>(asyncStubs)); + runtimePool = new RRPool<>(new CopyOnWriteArrayList<>(blockingStubs)); + + // init connections + init(asyncStubs, blockingStubs); + } + + protected void init(List asyncStubs, List blockingStubs) { + // TODO establish connection + } + + @Override + public void destroy() { + // get reference + ManagedChannel[] chs = channels; + // shutdown + if (chs != null) { + for (ManagedChannel c : chs) { + c.shutdown(); + } + channels = null; + } + } + + @Override + public A getAsyncStub() { + return asyncRuntimePool.next(); + } + + @Override + public B getBlockingStub() { + return runtimePool.next(); + } + + @Override + public ManagedChannel[] getChannels() { + return Arrays.copyOf(channels, channels.length); + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/RRPool.java b/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/RRPool.java new file mode 100644 index 0000000..d0fea1b --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/RRPool.java @@ -0,0 +1,68 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.grpc.stub; + +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; + +/** + * A utility to generate the next index in a pool + * + * @param + */ +public class RRPool { + private final List stubs; + private final RRIndex idx; + + /** + * Construct a RRPool + * + * @param stubs should be a concurrent safe list + */ + public RRPool(List stubs) { + this.stubs = stubs; + this.idx = new RRIndex(stubs.size()); + } + + public T next() { + return stubs.get(idx.next()); + } + + static class RRIndex { + private final static int mask = 0x7FFFFFFF; + AtomicInteger idx; + private final int size; + + RRIndex(int size) { + this.idx = new AtomicInteger(-1); + this.size = size; + } + + RRIndex(int idx, int size) { + this.idx = new AtomicInteger(idx); + this.size = size; + } + + int next() { + if (size == 1) { + return 0; + } + int n = idx.incrementAndGet(); + n = n & mask; + n = n % size; + return n; + } + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/SingleStubManager.java b/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/SingleStubManager.java new file mode 100644 index 0000000..05ad519 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/SingleStubManager.java @@ -0,0 +1,77 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.grpc.stub; + +import io.grpc.ManagedChannel; +import io.grpc.stub.AbstractAsyncStub; +import io.grpc.stub.AbstractBlockingStub; + +public class SingleStubManager + implements + StubManager { + + private volatile ManagedChannel channel; + private final A asyncStub; + private final B blockingStub; + + public SingleStubManager(ManagedChannel channel, + StubCreator sc) { + // 1. validate + if (channel == null) { + throw new IllegalArgumentException("Invalid channel"); + } + if (sc == null) { + throw new IllegalArgumentException("Invalid StubCreator"); + } + // 2. set fields + this.channel = channel; + asyncStub = sc.createAsyncStub(channel); + blockingStub = sc.createBlockingStub(channel); + // 3. init connections + init(asyncStub, blockingStub); + } + + protected void init(A newAsyncStub, B newBlockingStub) { + // TODO establish connection + } + + @Override + public B getBlockingStub() { + return blockingStub; + } + + @Override + public ManagedChannel[] getChannels() { + ManagedChannel[] chs = new ManagedChannel[1]; + chs[0] = channel; + return chs; + } + + @Override + public A getAsyncStub() { + return asyncStub; + } + + @Override + public void destroy() { + // 1. get reference + ManagedChannel ch = this.channel; + // 2. shutdown + if (ch != null) { + ch.shutdown(); + this.channel = null; + } + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/StubCreator.java b/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/StubCreator.java new file mode 100644 index 0000000..7b4a471 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/StubCreator.java @@ -0,0 +1,27 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.grpc.stub; + +import io.grpc.ManagedChannel; +import io.grpc.stub.AbstractAsyncStub; +import io.grpc.stub.AbstractBlockingStub; + +public interface StubCreator { + + A createAsyncStub(ManagedChannel channel); + + B createBlockingStub(ManagedChannel channel); + +} \ No newline at end of file diff --git a/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/StubManager.java b/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/StubManager.java new file mode 100644 index 0000000..f7fed61 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/grpc/stub/StubManager.java @@ -0,0 +1,33 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.grpc.stub; + +import io.grpc.ManagedChannel; +import io.grpc.stub.AbstractAsyncStub; +import io.grpc.stub.AbstractBlockingStub; + +/** + * An abstraction to manage grpc stub. It can be used to implement connection pool pattern + */ +public interface StubManager { + + A getAsyncStub(); + + B getBlockingStub(); + + ManagedChannel[] getChannels(); + + void destroy(); +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/serializer/AbstractSerializer.java b/sdk/src/main/java/io/mosn/layotto/v1/serializer/AbstractSerializer.java new file mode 100644 index 0000000..ad1da68 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/serializer/AbstractSerializer.java @@ -0,0 +1,59 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.serializer; + +import java.io.IOException; + +public abstract class AbstractSerializer implements ObjectSerializer { + /** + * {@inheritDoc} + */ + @Override + public byte[] serialize(Object o) throws IOException { + if (o == null) { + return null; + } + if (o instanceof byte[]) { + return (byte[]) o; + } + if (o instanceof String) { + return ((String) o).getBytes(); + } + + return doSerialize(o); + } + + protected abstract byte[] doSerialize(Object o) throws IOException; + + /** + * {@inheritDoc} + */ + @Override + public T deserialize(byte[] data, Class clazz) throws IOException { + if (data == null) { + return null; + } + if (clazz == byte[].class) { + return (T) data; + } + if (clazz == String.class) { + return (T) new String(data); + } + return doDeserialize(data, clazz); + } + + protected abstract T doDeserialize(byte[] data, Class clazz) throws IOException; + +} \ No newline at end of file diff --git a/sdk/src/main/java/io/mosn/layotto/v1/serializer/JSONSerializer.java b/sdk/src/main/java/io/mosn/layotto/v1/serializer/JSONSerializer.java new file mode 100644 index 0000000..6ba4ba1 --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/serializer/JSONSerializer.java @@ -0,0 +1,46 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.serializer; + +import com.alibaba.fastjson.JSONObject; + +import java.io.IOException; + +public class JSONSerializer extends AbstractSerializer { + + /** + * {@inheritDoc} + */ + @Override + protected byte[] doSerialize(Object o) throws IOException { + return JSONObject.toJSONBytes(o); + } + + /** + * {@inheritDoc} + */ + @Override + protected T doDeserialize(byte[] data, Class clazz) throws IOException { + return JSONObject.parseObject(data, clazz); + } + + /** + * {@inheritDoc} + */ + @Override + public String getContentType() { + return "application/json"; + } +} diff --git a/sdk/src/main/java/io/mosn/layotto/v1/serializer/ObjectSerializer.java b/sdk/src/main/java/io/mosn/layotto/v1/serializer/ObjectSerializer.java new file mode 100644 index 0000000..db3950f --- /dev/null +++ b/sdk/src/main/java/io/mosn/layotto/v1/serializer/ObjectSerializer.java @@ -0,0 +1,50 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.serializer; + +import java.io.IOException; + +/** + * Serializes and deserializes application's objects. + */ +public interface ObjectSerializer { + + /** + * Serializes the given object as byte[]. + * + * @param o Object to be serialized. + * @return Serialized object. + * @throws IOException If cannot serialize. + */ + byte[] serialize(Object o) throws IOException; + + /** + * Deserializes the given byte[] into a object. + * + * @param data Data to be deserialized. + * @param clazz Class of object to be deserialized. + * @param Type of object to be deserialized. + * @return Deserialized object. + * @throws IOException If cannot deserialize object. + */ + T deserialize(byte[] data, Class clazz) throws IOException; + + /** + * Returns the content type of the request. + * + * @return content type of the request + */ + String getContentType(); +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/client/RuntimeClient.java b/sdk/src/main/java/spec/sdk/runtime/v1/client/RuntimeClient.java new file mode 100644 index 0000000..f19f7d5 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/client/RuntimeClient.java @@ -0,0 +1,37 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.client; + +import spec.sdk.runtime.v1.domain.ConfigurationRuntime; +import spec.sdk.runtime.v1.domain.FileRuntime; +import spec.sdk.runtime.v1.domain.HelloRuntime; +import spec.sdk.runtime.v1.domain.InvocationRuntime; +import spec.sdk.runtime.v1.domain.LockRuntime; +import spec.sdk.runtime.v1.domain.PubSubRuntime; +import spec.sdk.runtime.v1.domain.SequencerRuntime; +import spec.sdk.runtime.v1.domain.StateRuntime; + +public interface RuntimeClient extends + HelloRuntime, + ConfigurationRuntime, + InvocationRuntime, + PubSubRuntime, + StateRuntime, + LockRuntime, + SequencerRuntime, + FileRuntime { + + void shutdown(); +} \ No newline at end of file diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/ConfigurationRuntime.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/ConfigurationRuntime.java new file mode 100644 index 0000000..89ba2c7 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/ConfigurationRuntime.java @@ -0,0 +1,18 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain; + +public interface ConfigurationRuntime { +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/FileRuntime.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/FileRuntime.java new file mode 100644 index 0000000..b4c77db --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/FileRuntime.java @@ -0,0 +1,66 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain; + +import spec.sdk.runtime.v1.domain.file.DelFileRequest; +import spec.sdk.runtime.v1.domain.file.DelFileResponse; +import spec.sdk.runtime.v1.domain.file.GetFileRequest; +import spec.sdk.runtime.v1.domain.file.GetFileResponse; +import spec.sdk.runtime.v1.domain.file.GetMetaRequest; +import spec.sdk.runtime.v1.domain.file.GetMeteResponse; +import spec.sdk.runtime.v1.domain.file.ListFileRequest; +import spec.sdk.runtime.v1.domain.file.ListFileResponse; +import spec.sdk.runtime.v1.domain.file.PutFileRequest; +import spec.sdk.runtime.v1.domain.file.PutFileResponse; + +public interface FileRuntime { + + /** + * save or update file + * + * @param request + * @param timeoutMs If the time is less than or equal to zero, the method will not wait at all. + * @throws Exception Instance of RuntimeClientException Or StatusRuntimeException + */ + PutFileResponse putFile(PutFileRequest request, int timeoutMs) throws Exception; + + /** + * @param request + * @param timeoutMs If the time is less than or equal to zero, the method will not wait at all. + * @throws Exception Instance of RuntimeClientException Or StatusRuntimeException + */ + GetFileResponse getFile(GetFileRequest request, int timeoutMs) throws Exception; + + /** + * @param request + * @param timeoutMs If the time is less than or equal to zero, the method will not wait at all. + * @throws Exception Instance of RuntimeClientException Or StatusRuntimeException + */ + ListFileResponse listFile(ListFileRequest request, int timeoutMs) throws Exception; + + /** + * @param request + * @param timeoutMs If the time is less than or equal to zero, the method will not wait at all. + * @throws Exception Instance of RuntimeClientException Or StatusRuntimeException + */ + DelFileResponse delFile(DelFileRequest request, int timeoutMs) throws Exception; + + /** + * @param request + * @param timeoutMs If the time is less than or equal to zero, the method will not wait at all. + * @throws Exception Instance of RuntimeClientException Or StatusRuntimeException + */ + GetMeteResponse getFileMeta(GetMetaRequest request, int timeoutMs) throws Exception; +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/HelloRuntime.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/HelloRuntime.java new file mode 100644 index 0000000..85d718c --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/HelloRuntime.java @@ -0,0 +1,22 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain; + +public interface HelloRuntime { + + String sayHello(String name); + + String sayHello(String name, int timeoutMillisecond); +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/InvocationRuntime.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/InvocationRuntime.java new file mode 100644 index 0000000..83e263f --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/InvocationRuntime.java @@ -0,0 +1,37 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain; + +import spec.sdk.runtime.v1.domain.invocation.InvokeResponse; + +import java.util.Map; + +public interface InvocationRuntime { + + InvokeResponse invokeMethod(String appId, String methodName, byte[] data, Map header); + + /** + * Invoke a service method. + * + * @param appId + * @param methodName + * @param data + * @param header + * @param timeoutMs can be customized every time a service method is called, since different services provide different SLA. + * @return + */ + InvokeResponse invokeMethod(String appId, String methodName, byte[] data, Map header, + int timeoutMs); +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/LockRuntime.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/LockRuntime.java new file mode 100644 index 0000000..94c8df2 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/LockRuntime.java @@ -0,0 +1,18 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain; + +public interface LockRuntime { +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/PubSubRuntime.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/PubSubRuntime.java new file mode 100644 index 0000000..0f1b09c --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/PubSubRuntime.java @@ -0,0 +1,52 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain; + +import java.util.Map; + +public interface PubSubRuntime { + /** + * Publish an event. + * + * @param pubsubName the pubsub name we will publish the event to + * @param topicName the topicName where the event will be published. + * @param data the event's data to be published, use byte[] for skipping serialization. + */ + //void publishEvent(String pubsubName, String topicName, Object data); + + /** + * Publish an event. + * + * @param pubsubName the pubsub name we will publish the event to + * @param topicName the topicName where the event will be published. + * @param data the event's data to be published, use byte[] for skipping serialization. + * @param metadata The metadata for the published event. + */ + //void publishEvent(String pubsubName, String topicName, Object data, Map metadata); + + /** + * Publish an event. + * + * @param pubsubName the pubsub name we will publish the event to + * @param topicName the topicName where the event will be published. + * @param data the event's data to be published, use byte[] for skipping serialization. + */ + void publishEvent(String pubsubName, String topicName, byte[] data); + + void publishEvent(String pubsubName, String topicName, byte[] data, Map metadata); + + void publishEvent(String pubsubName, String topicName, byte[] data, String contentType, Map metadata); + +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/SequencerRuntime.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/SequencerRuntime.java new file mode 100644 index 0000000..46c8bb6 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/SequencerRuntime.java @@ -0,0 +1,18 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain; + +public interface SequencerRuntime { +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/StateRuntime.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/StateRuntime.java new file mode 100644 index 0000000..0480c99 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/StateRuntime.java @@ -0,0 +1,196 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain; + +import spec.sdk.runtime.v1.domain.state.DeleteStateRequest; +import spec.sdk.runtime.v1.domain.state.ExecuteStateTransactionRequest; +import spec.sdk.runtime.v1.domain.state.GetBulkStateRequest; +import spec.sdk.runtime.v1.domain.state.GetStateRequest; +import spec.sdk.runtime.v1.domain.state.SaveStateRequest; +import spec.sdk.runtime.v1.domain.state.State; +import spec.sdk.runtime.v1.domain.state.StateOptions; +import spec.sdk.runtime.v1.domain.state.TransactionalStateOperation; + +import java.util.List; +import java.util.Map; + +public interface StateRuntime { + + /** + * Retrieve a State based on their key. + * + * @param storeName The name of the state store. + * @param key The key of the State to be retrieved. + * @param clazz The type of State needed as return. + * @param The type of the return. + */ + State getState(String storeName, String key, Class clazz); + + /** + * Retrieve a State based on their key. + * + * @param storeName The name of the state store. + * @param key The key of the State to be retrieved. + * @param options Optional settings for retrieve operation. + * @param clazz The Type of State needed as return. + * @param The Type of the return. + */ + State getState(String storeName, String key, StateOptions options, Class clazz); + + /** + * Retrieve a State based on their key. + * + * @param request The request to get state. + * @param clazz The Class of State needed as return. + * @param The Type of the return. + * @return The requested State. + */ + State getState(GetStateRequest request, Class clazz); + + /** + * Retrieve a State based on their key. + * + * @param request The request to get state. + * @param clazz The Class of State needed as return. + * @param timeoutMs + * @param The Type of the return. + * @return + */ + State getState(GetStateRequest request, Class clazz, int timeoutMs); + + /** + * Retrieve bulk States based on their keys. + * + * @param storeName The name of the state store. + * @param keys The keys of the State to be retrieved. + * @param clazz The type of State needed as return. + * @param The type of the return. + */ + List> getBulkState(String storeName, List keys, Class clazz); + + /** + * Retrieve bulk States based on their keys. + * + * @param request The request to get state. + * @param clazz The Class of State needed as return. + * @param The Type of the return. + * @return The requested State. + */ + List> getBulkState(GetBulkStateRequest request, Class clazz); + + /** + * Retrieve bulk States based on their keys. + * + * @param request The request to get state. + * @param clazz The Class of State needed as return. + * @param The Type of the return. + * @param timeoutMs The time limit(millisecond) of this call. + * @return The requested State. + */ + List> getBulkState(GetBulkStateRequest request, Class clazz, int timeoutMs); + + /** + * Execute a transaction. + * + * @param storeName The name of the state store. + * @param operations The operations to be performed. + */ + void executeStateTransaction(String storeName, + List> operations); + + /** + * Execute a transaction. + * + * @param request Request to execute transaction. + */ + void executeStateTransaction(ExecuteStateTransactionRequest request); + + /** + * Save/Update a list of states. + * + * @param storeName The name of the state store. + * @param states The States to be saved. + */ + void saveBulkState(String storeName, List> states); + + /** + * Save/Update a list of states. + * + * @param request Request to save states. + */ + void saveBulkState(SaveStateRequest request); + + /** + * Save/Update a list of states. + * + * @param request + * @param timeoutMs + */ + void saveBulkState(SaveStateRequest request, int timeoutMs); + + /** + * Save/Update a state. + * + * @param storeName The name of the state store. + * @param key The key of the state. + * @param value The value of the state. + */ + void saveState(String storeName, String key, Object value); + + /** + * Save/Update a state. + * + * @param storeName The name of the state store. + * @param key The key of the state. + * @param etag The etag to be used. + * @param value The value of the state. + * @param options The Options to use for each state. + */ + void saveState(String storeName, String key, String etag, Object value, StateOptions options, + Map metadata); + + /** + * Delete a state. + * + * @param storeName The name of the state store. + * @param key The key of the State to be removed. + */ + void deleteState(String storeName, String key); + + /** + * Delete a state. + * + * @param storeName The name of the state store. + * @param key The key of the State to be removed. + * @param etag Optional etag for conditional delete. + * @param options Optional settings for state operation. + */ + void deleteState(String storeName, String key, String etag, StateOptions options); + + /** + * Delete a state. + * + * @param request Request to delete a state. + */ + void deleteState(DeleteStateRequest request); + + /** + * Delete a state. + * + * @param request Request to delete a state. + * @param timeoutMs + */ + void deleteState(DeleteStateRequest request, int timeoutMs); +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/DelFileRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/DelFileRequest.java new file mode 100644 index 0000000..79b8cf0 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/DelFileRequest.java @@ -0,0 +1,56 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +import java.util.HashMap; +import java.util.Map; + +public class DelFileRequest { + + private String storeName; + private String fileName; + + private Map metaData; + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public Map getMetaData() { + + if (metaData == null) { + metaData = new HashMap<>(); + } + + return metaData; + } + + public void setMetaData(Map metaData) { + this.metaData = metaData; + } + +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/DelFileResponse.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/DelFileResponse.java new file mode 100644 index 0000000..97dad5a --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/DelFileResponse.java @@ -0,0 +1,18 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +public class DelFileResponse { +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/FileInfo.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/FileInfo.java new file mode 100644 index 0000000..a3a0ae6 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/FileInfo.java @@ -0,0 +1,69 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +import java.util.HashMap; +import java.util.Map; + +public class FileInfo { + private String fileName; + private long size; + private String lastModified; + private Map metaData; + + public FileInfo(String fileName, long size, String lastModified, Map metaData) { + this.fileName = fileName; + this.size = size; + this.lastModified = lastModified; + this.metaData = metaData; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public long getSize() { + return size; + } + + public void setSize(long size) { + this.size = size; + } + + public String getLastModified() { + return lastModified; + } + + public void setLastModified(String lastModified) { + this.lastModified = lastModified; + } + + public Map getMetaData() { + + if (metaData == null) { + metaData = new HashMap<>(); + } + + return metaData; + } + + public void setMetaData(Map metaData) { + this.metaData = metaData; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetFileRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetFileRequest.java new file mode 100644 index 0000000..1d8e534 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetFileRequest.java @@ -0,0 +1,55 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +import java.util.HashMap; +import java.util.Map; + +public class GetFileRequest { + + private String storeName; + private String fileName; + + private Map metaData; + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public Map getMetaData() { + + if (metaData == null) { + metaData = new HashMap<>(); + } + + return metaData; + } + + public void setMetaData(Map metaData) { + this.metaData = metaData; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetFileResponse.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetFileResponse.java new file mode 100644 index 0000000..905e55c --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetFileResponse.java @@ -0,0 +1,34 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +import java.io.InputStream; + +public class GetFileResponse { + + private InputStream in; + + public GetFileResponse(InputStream in) { + this.in = in; + } + + public InputStream getIn() { + return in; + } + + public void setIn(InputStream in) { + this.in = in; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetMetaRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetMetaRequest.java new file mode 100644 index 0000000..b1f856b --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetMetaRequest.java @@ -0,0 +1,55 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +import java.util.HashMap; +import java.util.Map; + +public class GetMetaRequest { + + private String storeName; + private String fileName; + + private Map metaData; + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public Map getMetaData() { + + if (metaData == null) { + metaData = new HashMap<>(); + } + + return metaData; + } + + public void setMetaData(Map metaData) { + this.metaData = metaData; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetMeteResponse.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetMeteResponse.java new file mode 100644 index 0000000..38553e7 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/GetMeteResponse.java @@ -0,0 +1,53 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +import java.util.HashMap; +import java.util.Map; + +public class GetMeteResponse { + private long size; + private String lastModified; + private Map meta; + + public long getSize() { + return size; + } + + public void setSize(long size) { + this.size = size; + } + + public String getLastModified() { + return lastModified; + } + + public void setLastModified(String lastModified) { + this.lastModified = lastModified; + } + + public Map getMeta() { + + if (meta == null) { + meta = new HashMap<>(); + } + + return meta; + } + + public void setMeta(Map meta) { + this.meta = meta; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/ListFileRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/ListFileRequest.java new file mode 100644 index 0000000..86ea4d8 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/ListFileRequest.java @@ -0,0 +1,73 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +import java.util.HashMap; +import java.util.Map; + +public class ListFileRequest { + + private String storeName; + private String name; + private Map metaData; + + private int pageSize; + private String marker; + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Map getMetaData() { + + if (metaData == null) { + metaData = new HashMap<>(); + } + + return metaData; + } + + public void setMetaData(Map metaData) { + this.metaData = metaData; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public String getMarker() { + return marker; + } + + public void setMarker(String marker) { + this.marker = marker; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/ListFileResponse.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/ListFileResponse.java new file mode 100644 index 0000000..23db57d --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/ListFileResponse.java @@ -0,0 +1,52 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +public class ListFileResponse { + + private boolean isTruncated; + private String marker; + + private FileInfo[] files; + + public boolean isTruncated() { + return isTruncated; + } + + public void setTruncated(boolean truncated) { + isTruncated = truncated; + } + + public String getMarker() { + return marker; + } + + public void setMarker(String marker) { + this.marker = marker; + } + + public FileInfo[] getFiles() { + + if (files == null) { + files = new FileInfo[0]; + } + + return files; + } + + public void setFiles(FileInfo[] files) { + this.files = files; + } +} \ No newline at end of file diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/PutFileRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/PutFileRequest.java new file mode 100644 index 0000000..fdef7c7 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/PutFileRequest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +import java.io.InputStream; +import java.util.HashMap; +import java.util.Map; + +public class PutFileRequest { + + private String storeName; + private String fileName; + + private Map metaData; + + private InputStream in; + + public String getStoreName() { + return storeName; + } + + public void setStoreName(String storeName) { + this.storeName = storeName; + } + + public String getFileName() { + return fileName; + } + + public void setFileName(String fileName) { + this.fileName = fileName; + } + + public Map getMetaData() { + + if (metaData == null) { + metaData = new HashMap<>(); + } + + return metaData; + } + + public void setMetaData(Map metaData) { + this.metaData = metaData; + } + + public InputStream getIn() { + return in; + } + + public void setIn(InputStream in) { + this.in = in; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/PutFileResponse.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/PutFileResponse.java new file mode 100644 index 0000000..44ac876 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/file/PutFileResponse.java @@ -0,0 +1,18 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.file; + +public class PutFileResponse { +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/invocation/InvokeResponse.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/invocation/InvokeResponse.java new file mode 100644 index 0000000..714c1fc --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/invocation/InvokeResponse.java @@ -0,0 +1,56 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.invocation; + +public class InvokeResponse { + private String contentType; + private T data; + + /** + * Getter method for property contentType. + * + * @return property value of contentType + */ + public String getContentType() { + return contentType; + } + + /** + * Setter method for property contentType. + * + * @param contentType value to be assigned to property contentType + */ + public void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter method for property data. + * + * @return property value of data + */ + public T getData() { + return data; + } + + /** + * Setter method for property data. + * + * @param data value to be assigned to property data + */ + public void setData(T data) { + this.data = data; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/TryLockRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/TryLockRequest.java new file mode 100644 index 0000000..9dcfbc5 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/TryLockRequest.java @@ -0,0 +1,22 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.lock; + +public class TryLockRequest { + public String storeName; + public String resourceId; + public String lockOwner; + public int expire; +} \ No newline at end of file diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/TryLockResponse.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/TryLockResponse.java new file mode 100644 index 0000000..30a4dbb --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/TryLockResponse.java @@ -0,0 +1,19 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.lock; + +public class TryLockResponse { + public boolean success; +} \ No newline at end of file diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/UnlockRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/UnlockRequest.java new file mode 100644 index 0000000..49458e6 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/UnlockRequest.java @@ -0,0 +1,21 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.lock; + +public class UnlockRequest { + public String storeName; + public String resourceId; + public String lockOwner; +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/UnlockResponse.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/UnlockResponse.java new file mode 100644 index 0000000..a12f819 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/lock/UnlockResponse.java @@ -0,0 +1,31 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.lock; + +enum UnlockResponseStatus { + SUCCESS(0), + LOCK_UNEXIST(1), + LOCK_BELONG_TO_OTHERS(2), + INTERNAL_ERROR(3); + private final int value; + + UnlockResponseStatus(int value) { + this.value = value; + } +} + +public class UnlockResponse { + public UnlockResponseStatus status; +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/PublishEventRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/PublishEventRequest.java new file mode 100644 index 0000000..3d7fe28 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/PublishEventRequest.java @@ -0,0 +1,125 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.pubsub; + +import java.util.Map; + +public class PublishEventRequest { + // The name of the pubsub component + private String pubsubName; + // The pubsub topic + private String topic; + // The data which will be published to topic. + private byte[] data; + + // The content type for the data (optional). + private String contentType; + + // The metadata passing to pub components + // + // metadata property: + // - key : the key of the message. + private Map metadata; + + /** + * Getter method for property pubsubName. + * + * @return property value of pubsubName + */ + public String getPubsubName() { + return pubsubName; + } + + /** + * Setter method for property pubsubName. + * + * @param pubsubName value to be assigned to property pubsubName + */ + public void setPubsubName(String pubsubName) { + this.pubsubName = pubsubName; + } + + /** + * Getter method for property topic. + * + * @return property value of topic + */ + public String getTopic() { + return topic; + } + + /** + * Setter method for property topic. + * + * @param topic value to be assigned to property topic + */ + public void setTopic(String topic) { + this.topic = topic; + } + + /** + * Getter method for property data. + * + * @return property value of data + */ + public byte[] getData() { + return data; + } + + /** + * Setter method for property data. + * + * @param data value to be assigned to property data + */ + public void setData(byte[] data) { + this.data = data; + } + + /** + * Getter method for property contentType. + * + * @return property value of contentType + */ + public String getContentType() { + return contentType; + } + + /** + * Setter method for property contentType. + * + * @param contentType value to be assigned to property contentType + */ + public void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter method for property metadata. + * + * @return property value of metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * Setter method for property metadata. + * + * @param metadata value to be assigned to property metadata + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicEventRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicEventRequest.java new file mode 100644 index 0000000..e907584 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicEventRequest.java @@ -0,0 +1,214 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.pubsub; + +import java.util.Map; + +public class TopicEventRequest { + // id identifies the event. Producers MUST ensure that source + id + // is unique for each distinct event. If a duplicate event is re-sent + // (e.g. due to a network error) it MAY have the same id. + private String id; + + // source identifies the context in which an event happened. + // Often this will include information such as the type of the + // event source, the organization publishing the event or the process + // that produced the event. The exact syntax and semantics behind + // the data encoded in the URI is defined by the event producer. + private String source; + + // The type of event related to the originating occurrence. + private String type; + + // The version of the CloudEvents specification. + private String specVersion; + + // The content type of data value. + private String contentType; + + // The content of the event. + private byte[] data; + + // The pubsub topic which publisher sent to. + private String topic; + + // The name of the pubsub the publisher sent to. + private String pubsubName; + + // add a map to pass some extra properties. + private Map metadata; + + /** + * Getter method for property id. + * + * @return property value of id + */ + public String getId() { + return id; + } + + /** + * Setter method for property id. + * + * @param id value to be assigned to property id + */ + public void setId(String id) { + this.id = id; + } + + /** + * Getter method for property source. + * + * @return property value of source + */ + public String getSource() { + return source; + } + + /** + * Setter method for property source. + * + * @param source value to be assigned to property source + */ + public void setSource(String source) { + this.source = source; + } + + /** + * Getter method for property type. + * + * @return property value of type + */ + public String getType() { + return type; + } + + /** + * Setter method for property type. + * + * @param type value to be assigned to property type + */ + public void setType(String type) { + this.type = type; + } + + /** + * Getter method for property specVersion. + * + * @return property value of specVersion + */ + public String getSpecVersion() { + return specVersion; + } + + /** + * Setter method for property specVersion. + * + * @param specVersion value to be assigned to property specVersion + */ + public void setSpecVersion(String specVersion) { + this.specVersion = specVersion; + } + + /** + * Getter method for property contentType. + * + * @return property value of contentType + */ + public String getContentType() { + return contentType; + } + + /** + * Setter method for property contentType. + * + * @param contentType value to be assigned to property contentType + */ + public void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Getter method for property data. + * + * @return property value of data + */ + public byte[] getData() { + return data; + } + + /** + * Setter method for property data. + * + * @param data value to be assigned to property data + */ + public void setData(byte[] data) { + this.data = data; + } + + /** + * Getter method for property topic. + * + * @return property value of topic + */ + public String getTopic() { + return topic; + } + + /** + * Setter method for property topic. + * + * @param topic value to be assigned to property topic + */ + public void setTopic(String topic) { + this.topic = topic; + } + + /** + * Getter method for property pubsubName. + * + * @return property value of pubsubName + */ + public String getPubsubName() { + return pubsubName; + } + + /** + * Setter method for property pubsubName. + * + * @param pubsubName value to be assigned to property pubsubName + */ + public void setPubsubName(String pubsubName) { + this.pubsubName = pubsubName; + } + + /** + * Getter method for property metadata. + * + * @return property value of metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * Setter method for property metadata. + * + * @param metadata value to be assigned to property metadata + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicEventResponse.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicEventResponse.java new file mode 100644 index 0000000..13272da --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicEventResponse.java @@ -0,0 +1,37 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.pubsub; + +public class TopicEventResponse { + private TopicEventResponseStatus status; + + /** + * Getter method for property status. + * + * @return property value of status + */ + public TopicEventResponseStatus getStatus() { + return status; + } + + /** + * Setter method for property status. + * + * @param status value to be assigned to property status + */ + public void setStatus(TopicEventResponseStatus status) { + this.status = status; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicEventResponseStatus.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicEventResponseStatus.java new file mode 100644 index 0000000..e59c760 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicEventResponseStatus.java @@ -0,0 +1,40 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.pubsub; + +// TopicEventResponseStatus allows apps to have finer control over handling of the message. +public enum TopicEventResponseStatus { + // SUCCESS is the default behavior: message is acknowledged and not retried or logged. + SUCCESS(0), + // RETRY status signals runtime to retry the message as part of an expected scenario (no warning is logged). + RETRY(1), + // DROP status signals runtime to drop the message as part of an unexpected scenario (warning is logged). + DROP(2); + + int idx; + + TopicEventResponseStatus(int idx) { + this.idx = idx; + } + + /** + * Getter method for property idx. + * + * @return property value of idx + */ + public int getIdx() { + return idx; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicSubscription.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicSubscription.java new file mode 100644 index 0000000..dcd8603 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/pubsub/TopicSubscription.java @@ -0,0 +1,82 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.pubsub; + +import java.util.Map; + +public class TopicSubscription { + // Required. The name of the pubsub containing the topic below to subscribe to. + private String pubsubName; + + // Required. The name of topic which will be subscribed + private String topic; + + // The optional properties used for this topic's subscription e.g. session id + private Map metadata; + + /** + * Getter method for property pubsub_name. + * + * @return property value of pubsub_name + */ + public String getPubsubName() { + return pubsubName; + } + + /** + * Setter method for property pubsub_name. + * + * @param pubsubName value to be assigned to property pubsub_name + */ + public void setPubsubName(String pubsubName) { + this.pubsubName = pubsubName; + } + + /** + * Getter method for property topic. + * + * @return property value of topic + */ + public String getTopic() { + return topic; + } + + /** + * Setter method for property topic. + * + * @param topic value to be assigned to property topic + */ + public void setTopic(String topic) { + this.topic = topic; + } + + /** + * Getter method for property metadata. + * + * @return property value of metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * Setter method for property metadata. + * + * @param metadata value to be assigned to property metadata + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/DeleteStateRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/DeleteStateRequest.java new file mode 100644 index 0000000..3223b21 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/DeleteStateRequest.java @@ -0,0 +1,110 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.state; + +import java.util.HashMap; +import java.util.Map; + +/** + * A request to delete a state by key. + */ +public class DeleteStateRequest { + + private final String stateStoreName; + + private final String key; + + private Map metadata = new HashMap<>(); + + private String etag; + + private StateOptions stateOptions; + + public DeleteStateRequest(String storeName, String key) { + this.stateStoreName = storeName; + this.key = key; + } + + public String getStateStoreName() { + return stateStoreName; + } + + public String getKey() { + return key; + } + + /** + * Getter method for property metadata. + * + * @return property value of metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * Setter method for property metadata. + * + * @param metadata value to be assigned to property metadata + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public void putMetadata(String key, String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + if (metadata == null) { + metadata = new HashMap<>(); + } + metadata.put(key, value); + } + + /** + * Getter method for property etag. + * + * @return property value of etag + */ + public String getEtag() { + return etag; + } + + /** + * Setter method for property etag. + * + * @param etag value to be assigned to property etag + */ + public void setEtag(String etag) { + this.etag = etag; + } + + /** + * Getter method for property stateOptions. + * + * @return property value of stateOptions + */ + public StateOptions getStateOptions() { + return stateOptions; + } + + /** + * Setter method for property stateOptions. + * + * @param stateOptions value to be assigned to property stateOptions + */ + public void setStateOptions(StateOptions stateOptions) { + this.stateOptions = stateOptions; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/ExecuteStateTransactionRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/ExecuteStateTransactionRequest.java new file mode 100644 index 0000000..0b21f4c --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/ExecuteStateTransactionRequest.java @@ -0,0 +1,91 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.state; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ExecuteStateTransactionRequest { + + /** + * Name of the state store. + */ + private final String stateStoreName; + + /** + * Transactional operations list. + */ + private List> operations; + + /** + * Metadata used for transactional operations. + */ + private Map metadata = new HashMap<>(); + + public ExecuteStateTransactionRequest(String stateStoreName) { + this.stateStoreName = stateStoreName; + } + + public String getStateStoreName() { + return stateStoreName; + } + + /** + * Getter method for property operations. + * + * @return property value of operations + */ + public List> getOperations() { + return operations; + } + + /** + * Setter method for property operations. + * + * @param operations value to be assigned to property operations + */ + public void setOperations(List> operations) { + this.operations = operations; + } + + /** + * Getter method for property metadata. + * + * @return property value of metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * Setter method for property metadata. + * + * @param metadata value to be assigned to property metadata + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public void putMetadata(String key, String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + if (metadata == null) { + metadata = new HashMap<>(); + } + metadata.put(key, value); + } + +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/GetBulkStateRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/GetBulkStateRequest.java new file mode 100644 index 0000000..fed07d6 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/GetBulkStateRequest.java @@ -0,0 +1,98 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.state; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * A request to get bulk state by keys. + */ +public class GetBulkStateRequest { + + private final String storeName; + + private final List keys; + + private Map metadata = new HashMap<>(); + + private int parallelism = 1; + + public GetBulkStateRequest(String storeName, List keys) { + this.storeName = storeName; + this.keys = keys == null ? null : Collections.unmodifiableList(keys); + } + + public GetBulkStateRequest(String storeName, String... keys) { + this.storeName = storeName; + this.keys = keys == null ? null : Collections.unmodifiableList(Arrays.asList(keys)); + } + + public String getStoreName() { + return storeName; + } + + public List getKeys() { + return keys; + } + + /** + * Getter method for property metadata. + * + * @return property value of metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * Setter method for property metadata. + * + * @param metadata value to be assigned to property metadata + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public void putMetadata(String key, String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + if (metadata == null) { + metadata = new HashMap<>(); + } + metadata.put(key, value); + } + + /** + * Getter method for property parallelism. + * + * @return property value of parallelism + */ + public int getParallelism() { + return parallelism; + } + + /** + * Setter method for property parallelism. + * + * @param parallelism value to be assigned to property parallelism + */ + public void setParallelism(int parallelism) { + this.parallelism = parallelism; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/GetStateRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/GetStateRequest.java new file mode 100644 index 0000000..e6443c3 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/GetStateRequest.java @@ -0,0 +1,90 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.state; + +import java.util.HashMap; +import java.util.Map; + +/** + * A request to get a state by key. + */ +public class GetStateRequest { + + private final String storeName; + + private final String key; + + private Map metadata = new HashMap<>(); + + private StateOptions stateOptions; + + public GetStateRequest(String storeName, String key) { + this.storeName = storeName; + this.key = key; + } + + public String getStoreName() { + return storeName; + } + + public String getKey() { + return key; + } + + /** + * Getter method for property metadata. + * + * @return property value of metadata + */ + public Map getMetadata() { + return metadata; + } + + /** + * Setter method for property metadata. + * + * @param metadata value to be assigned to property metadata + */ + public void setMetadata(Map metadata) { + this.metadata = metadata; + } + + public void putMetadata(String key, String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + if (metadata == null) { + metadata = new HashMap<>(); + } + metadata.put(key, value); + } + + /** + * Getter method for property stateOptions. + * + * @return property value of stateOptions + */ + public StateOptions getStateOptions() { + return stateOptions; + } + + /** + * Setter method for property stateOptions. + * + * @param stateOptions value to be assigned to property stateOptions + */ + public void setStateOptions(StateOptions stateOptions) { + this.stateOptions = stateOptions; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/SaveStateRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/SaveStateRequest.java new file mode 100644 index 0000000..9885b85 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/SaveStateRequest.java @@ -0,0 +1,53 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.state; + +import java.util.List; + +/** + * A request to save states to state store. + */ +public class SaveStateRequest { + + private final String storeName; + + private List> states; + + public SaveStateRequest(String storeName) { + this.storeName = storeName; + } + + public String getStoreName() { + return storeName; + } + + /** + * Getter method for property states. + * + * @return property value of states + */ + public List> getStates() { + return states; + } + + /** + * Setter method for property states. + * + * @param states value to be assigned to property states + */ + public void setStates(List> states) { + this.states = states; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/State.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/State.java new file mode 100644 index 0000000..88c2619 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/State.java @@ -0,0 +1,207 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.state; + +import java.util.Map; + +/** + * This class reprent what a State is. + * + * @param The type of the value of the state + */ +public class State { + + /** + * The key of the state. + */ + private final String key; + + /** + * The value of the state. + */ + private final T value; + + /** + * The ETag to be used Keep in mind that for some state stores (like redis) only numbers are supported. + */ + private final String etag; + + /** + * The metadata which will be passed to state store component. + */ + private final Map metadata; + + /** + * The error in case the key could not be retrieved. + */ + private final String error; + + /** + * The options used for saving the state. + */ + private final StateOptions options; + + /** + * Create an immutable state reference to be retrieved or deleted. This Constructor CAN be used anytime you need to retrieve or delete a + * state. + * + * @param key - The key of the state + */ + public State(String key) { + this.key = key; + this.value = null; + this.etag = null; + this.metadata = null; + this.options = null; + this.error = null; + } + + /** + * Create an immutable state. This Constructor MUST be used anytime the key could not be retrieved and contains an error. + * + * @param key - The key of the state. + * @param error - Error when fetching the state. + */ + public State(String key, String error) { + this.value = null; + this.key = key; + this.etag = null; + this.metadata = null; + this.options = null; + this.error = error; + } + + /** + * Create an immutable state reference to be retrieved or deleted. This Constructor CAN be used anytime you need to retrieve or delete a + * state. + * + * @param key - The key of the state + * @param etag - The etag of the state - Keep in mind that for some state stores (like redis) only numbers are supported. + * @param options - REQUIRED when saving a state. + */ + public State(String key, String etag, StateOptions options) { + this.value = null; + this.key = key; + this.etag = etag; + this.metadata = null; + this.options = options; + this.error = null; + } + + /** + * Create an immutable state. This Constructor CAN be used anytime you want the state to be saved. + * + * @param key - The key of the state. + * @param value - The value of the state. + * @param etag - The etag of the state - for some state stores (like redis) only numbers are supported. + * @param options - REQUIRED when saving a state. + */ + public State(String key, T value, String etag, StateOptions options) { + this.value = value; + this.key = key; + this.etag = etag; + this.metadata = null; + this.options = options; + this.error = null; + } + + /** + * Create an immutable state. This Constructor CAN be used anytime you want the state to be saved. + * + * @param key - The key of the state. + * @param value - The value of the state. + * @param etag - The etag of the state - for some state stores (like redis) only numbers are supported. + * @param metadata - The metadata of the state. + * @param options - REQUIRED when saving a state. + */ + public State(String key, T value, String etag, Map metadata, StateOptions options) { + this.value = value; + this.key = key; + this.etag = etag; + this.metadata = metadata; + this.options = options; + this.error = null; + } + + /** + * Create an immutable state. This Constructor CAN be used anytime you want the state to be saved. + * + * @param key - The key of the state. + * @param value - The value of the state. + * @param etag - The etag of the state - some state stores (like redis) only numbers are supported. + */ + public State(String key, T value, String etag) { + this.value = value; + this.key = key; + this.etag = etag; + this.metadata = null; + this.options = null; + this.error = null; + } + + /** + * Retrieves the Value of the state. + * + * @return The value of the state + */ + public T getValue() { + return value; + } + + /** + * Retrieves the Key of the state. + * + * @return The key of the state + */ + public String getKey() { + return key; + } + + /** + * Retrieve the ETag of this state. + * + * @return The etag of the state + */ + public String getEtag() { + return etag; + } + + /** + * Retrieve the metadata of this state. + * + * @return the metadata of this state + */ + public Map getMetadata() { + return metadata; + } + + /** + * Retrieve the Options used for saving the state. + * + * @return The options to save the state + */ + public StateOptions getOptions() { + return options; + } + + /** + * Getter method for property error. + * + * @return property value of error + */ + public String getError() { + return error; + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/StateOptions.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/StateOptions.java new file mode 100644 index 0000000..97b9868 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/StateOptions.java @@ -0,0 +1,76 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.state; + +public class StateOptions { + private final Consistency consistency; + private final Concurrency concurrency; + + /** + * Represents options for a state API call. + * @param consistency The consistency mode. + * @param concurrency The concurrency mode. + */ + public StateOptions(Consistency consistency, Concurrency concurrency) { + this.consistency = consistency; + this.concurrency = concurrency; + } + + public Concurrency getConcurrency() { + return concurrency; + } + + public Consistency getConsistency() { + return consistency; + } + + public enum Consistency { + EVENTUAL("eventual"), + STRONG("strong"); + + private final String value; + + Consistency(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } + + public static Consistency fromValue(String value) { + return Consistency.valueOf(value); + } + } + + public enum Concurrency { + FIRST_WRITE("first-write"), + LAST_WRITE("last-write"); + + private final String value; + + Concurrency(String value) { + this.value = value; + } + + public String getValue() { + return this.value; + } + + public static Concurrency fromValue(String value) { + return Concurrency.valueOf(value); + } + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/TransactionalStateOperation.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/TransactionalStateOperation.java new file mode 100644 index 0000000..05c3954 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/TransactionalStateOperation.java @@ -0,0 +1,52 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.state; + +public class TransactionalStateOperation { + + /** + * The type of operation to be executed. + */ + private final OperationType operation; + + /** + * State values to be operated on. + */ + private final State request; + + /** + * Construct an immutable transactional state operation object. + * + * @param operationType The type of operation done. + * @param state The required state. + */ + public TransactionalStateOperation(OperationType operationType, State state) { + this.operation = operationType; + this.request = state; + } + + public OperationType getOperation() { + return operation; + } + + public State getRequest() { + return request; + } + + public enum OperationType { + UPSERT, + DELETE + } +} diff --git a/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/TransactionalStateRequest.java b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/TransactionalStateRequest.java new file mode 100644 index 0000000..fdd0bc7 --- /dev/null +++ b/sdk/src/main/java/spec/sdk/runtime/v1/domain/state/TransactionalStateRequest.java @@ -0,0 +1,61 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package spec.sdk.runtime.v1.domain.state; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +public class TransactionalStateRequest { + + /** + * Transactional operations list. + */ + private final List> operations; + + /** + * Metadata used for transactional operations. + */ + private final Map metadata; + + /** + * Constructor to create immutable transactional state request object. + * + * @param operations List of operations to be performed. + * @param metadata Metadata used for transactional operations. + */ + public TransactionalStateRequest(List> operations, Map metadata) { + this.operations = operations; + this.metadata = metadata; + } + + public List> getOperations() { + return Collections.unmodifiableList(operations); + } + + public Map getMetadata() { + return metadata; + } + + public void putMetadata(String key, String value) { + if (key == null) { + throw new java.lang.NullPointerException(); + } + if (value == null) { + throw new java.lang.NullPointerException(); + } + metadata.put(key, value); + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/FileTest.java b/sdk/src/test/java/io/mosn/layotto/v1/FileTest.java new file mode 100644 index 0000000..e25b9d3 --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/FileTest.java @@ -0,0 +1,360 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import io.grpc.ManagedChannel; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import io.grpc.testing.GrpcCleanupRule; +import io.mosn.layotto.v1.mock.MyFileService; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.sdk.runtime.v1.client.RuntimeClient; +import spec.sdk.runtime.v1.domain.file.DelFileRequest; +import spec.sdk.runtime.v1.domain.file.FileInfo; +import spec.sdk.runtime.v1.domain.file.GetFileRequest; +import spec.sdk.runtime.v1.domain.file.GetFileResponse; +import spec.sdk.runtime.v1.domain.file.GetMetaRequest; +import spec.sdk.runtime.v1.domain.file.GetMeteResponse; +import spec.sdk.runtime.v1.domain.file.ListFileRequest; +import spec.sdk.runtime.v1.domain.file.ListFileResponse; +import spec.sdk.runtime.v1.domain.file.PutFileRequest; + +import java.io.ByteArrayInputStream; +import java.util.HashMap; +import java.util.Map; + +import static org.mockito.AdditionalAnswers.delegatesTo; +import static org.mockito.Mockito.mock; + +@RunWith(JUnit4.class) +public class FileTest { + @Rule + public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + + RuntimeGrpc.RuntimeImplBase fileService = new MyFileService(); + + private final RuntimeGrpc.RuntimeImplBase serviceImpl = mock(RuntimeGrpc.RuntimeImplBase.class, + delegatesTo(fileService)); + + private RuntimeClient client; + + @Before + public void setUp() throws Exception { + String serverName = InProcessServerBuilder.generateName(); + grpcCleanup.register(InProcessServerBuilder + .forName(serverName).directExecutor() + .addService(serviceImpl) + .build().start()); + ManagedChannel channel = grpcCleanup.register( + InProcessChannelBuilder.forName(serverName).directExecutor().build()); + client = new RuntimeClientBuilder() + .buildGrpcWithExistingChannel(channel); + } + + // normal case + @Test + public void testPutFile1() throws Exception { + + PutFileRequest req = new PutFileRequest(); + req.setIn(new ByteArrayInputStream("hello world".getBytes())); + req.setStoreName( "oss"); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.putFile(req, 10000); + } + + // miss request + @Test(expected = IllegalArgumentException.class) + public void testPutFile2() throws Exception { + client.putFile(null, 10000); + } + + // miss in stream + @Test(expected = IllegalArgumentException.class) + public void testPutFile3() throws Exception { + + PutFileRequest req = new PutFileRequest(); + req.setStoreName("oss"); + req.setFileName("test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.putFile(req, 10000); + } + + // miss file name + @Test(expected = IllegalArgumentException.class) + public void testPutFile4() throws Exception { + + PutFileRequest req = new PutFileRequest(); + req.setIn(new ByteArrayInputStream("hello world".getBytes())); + req.setStoreName( "oss"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.putFile(req, 10000); + } + + // miss store name + @Test(expected = IllegalArgumentException.class) + public void testPutFile5() throws Exception { + + PutFileRequest req = new PutFileRequest(); + req.setIn(new ByteArrayInputStream("hello world".getBytes())); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.putFile(req, 10000); + } + + // normal case + @Test + public void testGetFile1() throws Exception { + + GetFileRequest req = new GetFileRequest(); + req.setStoreName( "oss"); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + GetFileResponse resp = client.getFile(req, 10000); + + byte[] buf = new byte[126]; + int len = resp.getIn().read(buf); + + String echo = new String(buf,0,len); + Assert.assertEquals("get file store name oss, meta 2, file name test.log", echo); + } + + // miss request + @Test(expected = IllegalArgumentException.class) + public void testGetFile2() throws Exception { + client.getFile(null, 10000); + } + + // miss store name + @Test(expected = IllegalArgumentException.class) + public void testGetFile3() throws Exception { + + GetFileRequest req = new GetFileRequest(); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.getFile(req, 10000); + } + + // miss file name + @Test(expected = IllegalArgumentException.class) + public void testGetFile4() throws Exception { + + GetFileRequest req = new GetFileRequest(); + req.setStoreName( "oss"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.getFile(req, 10000); + } + + // normal case + @Test + public void testDelFile1() throws Exception { + + DelFileRequest req = new DelFileRequest(); + req.setStoreName( "oss"); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.delFile(req, 10000); + } + + // miss request + @Test(expected = IllegalArgumentException.class) + public void testDelFile2() throws Exception { + client.delFile(null, 10000); + } + + // miss store name + @Test(expected = IllegalArgumentException.class) + public void testDelFile3() throws Exception { + + DelFileRequest req = new DelFileRequest(); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.delFile(req, 10000); + } + + // miss file name + @Test(expected = IllegalArgumentException.class) + public void testDelFile4() throws Exception { + + DelFileRequest req = new DelFileRequest(); + req.setStoreName( "oss"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.delFile(req, 10000); + } + + // normal + @Test + public void testListFile1() throws Exception { + + ListFileRequest req = new ListFileRequest(); + req.setStoreName( "oss"); + req.setName("dir"); + req.setMarker("test.log"); + req.setPageSize(10); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + ListFileResponse resp = client.listFile(req, 10000); + + Assert.assertTrue(resp.isTruncated()); + Assert.assertEquals("marker", resp.getMarker()); + Assert.assertEquals(1, resp.getFiles().length); + + FileInfo f = resp.getFiles()[0]; + Assert.assertEquals("put file store name oss, meta 2", f.getFileName()); + Assert.assertEquals(100L, f.getSize()); + Assert.assertEquals("2021-11-23 10:24:11", f.getLastModified()); + Assert.assertEquals("v1", f.getMetaData().get("k1")); + } + + // miss request + @Test(expected = IllegalArgumentException.class) + public void testListFile2() throws Exception { + client.listFile(null, 10000); + } + + // miss store name + @Test(expected = IllegalArgumentException.class) + public void testListFile3() throws Exception { + + ListFileRequest req = new ListFileRequest(); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + ListFileResponse notUsed = client.listFile(req, 10000); + } + + // normal + @Test + public void testGetFileMeta1() throws Exception { + + GetMetaRequest req = new GetMetaRequest(); + req.setStoreName( "oss"); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + GetMeteResponse res = client.getFileMeta(req, 10000); + + Assert.assertEquals(100L, res.getSize()); + Assert.assertEquals("2021-11-22 10:24:11", res.getLastModified()); + Assert.assertArrayEquals(new String[]{"v1", "v2"}, res.getMeta().get("k1")); + } + + // miss request + @Test(expected = IllegalArgumentException.class) + public void testGetFileMeta2() throws Exception { + client.getFileMeta(null, 10000); + } + + // miss store name + @Test(expected = IllegalArgumentException.class) + public void testGetFileMeta3() throws Exception { + + GetMetaRequest req = new GetMetaRequest(); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + GetMeteResponse res = client.getFileMeta(req, 10000); + + Assert.assertEquals(100L, res.getSize()); + Assert.assertEquals("2021-11-22 10:24:11", res.getLastModified()); + Assert.assertArrayEquals(new String[]{"v1", "v2"}, res.getMeta().get("k1")); + } + + // miss file name + @Test(expected = IllegalArgumentException.class) + public void testGetFileMeta4() throws Exception { + + GetMetaRequest req = new GetMetaRequest(); + req.setStoreName( "oss"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.getFileMeta(req, 10000); + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/FileTestWithRealServer.java b/sdk/src/test/java/io/mosn/layotto/v1/FileTestWithRealServer.java new file mode 100644 index 0000000..4803adb --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/FileTestWithRealServer.java @@ -0,0 +1,366 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.mosn.layotto.v1.grpc.ExceptionHandler; +import io.mosn.layotto.v1.grpc.GrpcRuntimeClient; +import io.mosn.layotto.v1.mock.MyFileService; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.sdk.runtime.v1.domain.file.DelFileRequest; +import spec.sdk.runtime.v1.domain.file.FileInfo; +import spec.sdk.runtime.v1.domain.file.GetFileRequest; +import spec.sdk.runtime.v1.domain.file.GetFileResponse; +import spec.sdk.runtime.v1.domain.file.GetMetaRequest; +import spec.sdk.runtime.v1.domain.file.GetMeteResponse; +import spec.sdk.runtime.v1.domain.file.ListFileRequest; +import spec.sdk.runtime.v1.domain.file.ListFileResponse; +import spec.sdk.runtime.v1.domain.file.PutFileRequest; + +import java.io.ByteArrayInputStream; +import java.util.HashMap; +import java.util.Map; + +@RunWith(JUnit4.class) +public class FileTestWithRealServer { + + private final RuntimeGrpc.RuntimeImplBase fileService = new MyFileService(); + + private Server srv; + private GrpcRuntimeClient client; + + int port = 9999; + String ip = "127.0.0.1"; + + @Before + public void setUp() throws Exception { + // start grpc server + /* The port on which the server should run */ + srv = ServerBuilder.forPort(port) + .addService(fileService) + .intercept(new ExceptionHandler()) + .build() + .start(); + + // build a client + client = new RuntimeClientBuilder() + .withIp(ip) + .withPort(port) + .withConnectionPoolSize(4) + .withTimeout(1000) + .buildGrpc(); + } + + @After + public void shutdown() { + client.shutdown(); + srv.shutdownNow(); + } + + // normal case + @Test + public void testPutFile1() throws Exception { + + PutFileRequest req = new PutFileRequest(); + req.setIn( new ByteArrayInputStream("hello world".getBytes())); + req.setStoreName("oss"); + req.setFileName("test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.putFile(req, 10000); + } + + // miss request + @Test(expected = IllegalArgumentException.class) + public void testPutFile2() throws Exception { + client.putFile(null, 10000); + } + + // miss in stream + @Test(expected = IllegalArgumentException.class) + public void testPutFile3() throws Exception { + + PutFileRequest req = new PutFileRequest(); + req.setStoreName( "oss"); + req.setFileName("test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.putFile(req, 10000); + } + + // miss file name + @Test(expected = IllegalArgumentException.class) + public void testPutFile4() throws Exception { + + PutFileRequest req = new PutFileRequest(); + req.setIn( new ByteArrayInputStream("hello world".getBytes())); + req.setStoreName( "oss"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.putFile(req, 10000); + } + + // miss store name + @Test(expected = IllegalArgumentException.class) + public void testPutFile5() throws Exception { + + PutFileRequest req = new PutFileRequest(); + req.setIn( new ByteArrayInputStream("hello world".getBytes())); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.putFile(req, 10000); + } + + // normal case + @Test + public void testGetFile1() throws Exception { + + GetFileRequest req = new GetFileRequest(); + req.setStoreName( "oss"); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + GetFileResponse resp = client.getFile(req, 10000); + + byte[] buf = new byte[126]; + int len = resp.getIn().read(buf); + + String echo = new String(buf,0,len); + Assert.assertEquals("get file store name oss, meta 2, file name test.log", echo); + } + + // miss request + @Test(expected = IllegalArgumentException.class) + public void testGetFile2() throws Exception { + client.getFile(null, 10000); + } + + // miss store name + @Test(expected = IllegalArgumentException.class) + public void testGetFile3() throws Exception { + + GetFileRequest req = new GetFileRequest(); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.getFile(req, 10000); + } + + // miss file name + @Test(expected = IllegalArgumentException.class) + public void testGetFile4() throws Exception { + + GetFileRequest req = new GetFileRequest(); + req.setStoreName( "oss"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.getFile(req, 10000); + } + + // normal case + @Test + public void testDelFile1() throws Exception { + + DelFileRequest req = new DelFileRequest(); + req.setStoreName( "oss"); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.delFile(req, 10000); + } + + // miss request + @Test(expected = IllegalArgumentException.class) + public void testDelFile2() throws Exception { + client.delFile(null, 10000); + } + + // miss store name + @Test(expected = IllegalArgumentException.class) + public void testDelFile3() throws Exception { + + DelFileRequest req = new DelFileRequest(); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.delFile(req, 10000); + } + + // miss file name + @Test(expected = IllegalArgumentException.class) + public void testDelFile4() throws Exception { + + DelFileRequest req = new DelFileRequest(); + req.setStoreName( "oss"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.delFile(req, 10000); + } + + // normal + @Test + public void testListFile1() throws Exception { + + ListFileRequest req = new ListFileRequest(); + req.setStoreName( "oss"); + req.setName("dir"); + req.setMarker("test.log"); + req.setPageSize(10); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + ListFileResponse resp = client.listFile(req, 10000); + + Assert.assertTrue(resp.isTruncated()); + Assert.assertEquals("marker", resp.getMarker()); + Assert.assertEquals(1, resp.getFiles().length); + + FileInfo f = resp.getFiles()[0]; + Assert.assertEquals("put file store name oss, meta 2", f.getFileName()); + Assert.assertEquals(100L, f.getSize()); + Assert.assertEquals("2021-11-23 10:24:11", f.getLastModified()); + Assert.assertEquals("v1", f.getMetaData().get("k1")); + } + + // miss request + @Test(expected = IllegalArgumentException.class) + public void testListFile2() throws Exception { + client.listFile(null, 10000); + } + + // miss store name + @Test(expected = IllegalArgumentException.class) + public void testListFile3() throws Exception { + + ListFileRequest req = new ListFileRequest(); + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + ListFileResponse resp = client.listFile(req, 10000); + } + + // normal + @Test + public void testGetFileMeta1() throws Exception { + + GetMetaRequest req = new GetMetaRequest(); + req.setStoreName( "oss"); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + GetMeteResponse res = client.getFileMeta(req, 10000); + + Assert.assertEquals(100L,res.getSize()); + Assert.assertEquals("2021-11-22 10:24:11",res.getLastModified()); + Assert.assertArrayEquals(new String[]{"v1","v2"},res.getMeta().get("k1")); + } + + // miss request + @Test(expected = IllegalArgumentException.class) + public void testGetFileMeta2() throws Exception { + client.getFileMeta(null, 10000); + } + + // miss store name + @Test(expected = IllegalArgumentException.class) + public void testGetFileMeta3() throws Exception { + + GetMetaRequest req = new GetMetaRequest(); + req.setFileName( "test.log"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + GetMeteResponse res = client.getFileMeta(req, 10000); + + Assert.assertEquals(100L,res.getSize()); + Assert.assertEquals("2021-11-22 10:24:11",res.getLastModified()); + Assert.assertArrayEquals(new String[]{"v1","v2"},res.getMeta().get("k1")); + } + + // miss file name + @Test(expected = IllegalArgumentException.class) + public void testGetFileMeta4() throws Exception { + + GetMetaRequest req = new GetMetaRequest(); + req.setStoreName( "oss"); + + Map metaData = new HashMap<>(); + metaData.put("k1", "v1"); + metaData.put("k2", "v2"); + req.setMetaData(metaData); + + client.getFileMeta(req, 10000); + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/PublishEventTest.java b/sdk/src/test/java/io/mosn/layotto/v1/PublishEventTest.java new file mode 100644 index 0000000..dca6f11 --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/PublishEventTest.java @@ -0,0 +1,69 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import io.grpc.ManagedChannel; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import io.grpc.testing.GrpcCleanupRule; +import io.mosn.layotto.v1.mock.MyPublishService; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.proto.runtime.v1.RuntimeProto; +import spec.sdk.runtime.v1.client.RuntimeClient; + +import static org.mockito.AdditionalAnswers.delegatesTo; +import static org.mockito.Mockito.mock; + +@RunWith(JUnit4.class) +public class PublishEventTest { + @Rule + public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + + private final MyPublishService mockService = new MyPublishService(); + + private final RuntimeGrpc.RuntimeImplBase serviceImpl = + mock(RuntimeGrpc.RuntimeImplBase.class, + delegatesTo(mockService)); + + private RuntimeClient client; + + @Before + public void setUp() throws Exception { + String serverName = InProcessServerBuilder.generateName(); + grpcCleanup.register(InProcessServerBuilder + .forName(serverName).directExecutor() + .addService(serviceImpl) + .build().start()); + ManagedChannel channel = grpcCleanup.register( + InProcessChannelBuilder.forName(serverName).directExecutor().build()); + client = new RuntimeClientBuilder() + .buildGrpcWithExistingChannel(channel); + } + + @Test + public void testPublishEvent() { + client.publishEvent("redis", "hello", "word".getBytes()); + RuntimeProto.PublishEventRequest last = mockService.getLastReq(); + Assert.assertEquals(last.getPubsubName(), "redis"); + Assert.assertEquals(last.getTopic(), "hello"); + Assert.assertEquals(new String(last.getData().toByteArray()), "word"); + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/PublishEventTestWithRealServer.java b/sdk/src/test/java/io/mosn/layotto/v1/PublishEventTestWithRealServer.java new file mode 100644 index 0000000..f33ac3c --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/PublishEventTestWithRealServer.java @@ -0,0 +1,74 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.mosn.layotto.v1.grpc.ExceptionHandler; +import io.mosn.layotto.v1.grpc.GrpcRuntimeClient; +import io.mosn.layotto.v1.mock.MyPublishService; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import spec.proto.runtime.v1.RuntimeProto; + +@RunWith(JUnit4.class) +public class PublishEventTestWithRealServer { + + private final MyPublishService mockService = new MyPublishService(); + + private Server srv; + private GrpcRuntimeClient client; + + int port = 9999; + String ip = "127.0.0.1"; + + @Before + public void setUp() throws Exception { + // start grpc server + /* The port on which the server should run */ + srv = ServerBuilder.forPort(port) + .addService(mockService) + .intercept(new ExceptionHandler()) + .build() + .start(); + + // build a client + client = new RuntimeClientBuilder() + .withIp(ip) + .withPort(port) + .withConnectionPoolSize(4) + .withTimeout(2000) + .buildGrpc(); + } + + @After + public void shutdown() throws InterruptedException { + client.shutdown(); + srv.shutdownNow(); + } + + @Test + public void testPublishEvent() { + client.publishEvent("redis", "hello", "word".getBytes()); + RuntimeProto.PublishEventRequest last = mockService.getLastReq(); + Assert.assertEquals(last.getPubsubName(), "redis"); + Assert.assertEquals(last.getTopic(), "hello"); + Assert.assertEquals(new String(last.getData().toByteArray()), "word"); + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/RuntimeClientBuilderTest.java b/sdk/src/test/java/io/mosn/layotto/v1/RuntimeClientBuilderTest.java new file mode 100644 index 0000000..28ad487 --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/RuntimeClientBuilderTest.java @@ -0,0 +1,62 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// CODE ATTRIBUTION: https://github.com/dapr/java-sdk +// Modified some test cases to test layotto's code +package io.mosn.layotto.v1; + +import io.mosn.layotto.v1.serializer.ObjectSerializer; +import org.junit.Assert; +import org.junit.Test; +import spec.sdk.runtime.v1.client.RuntimeClient; + +import static org.mockito.Mockito.mock; + +public class RuntimeClientBuilderTest { + + @Test + public void build() { + ObjectSerializer stateSerializer = mock(ObjectSerializer.class); + RuntimeClientBuilder builder = new RuntimeClientBuilder(); + builder.withStateSerializer(stateSerializer); + RuntimeClient client = builder.build(); + Assert.assertNotNull(client); + } + + @Test(expected = IllegalArgumentException.class) + public void noLogger() { + new RuntimeClientBuilder().withLogger(null); + } + + @Test(expected = IllegalArgumentException.class) + public void noTimeout() { + new RuntimeClientBuilder().withTimeout(0); + } + + @Test(expected = IllegalArgumentException.class) + public void noPort() { + new RuntimeClientBuilder().withPort(0); + } + + @Test(expected = IllegalArgumentException.class) + public void noStateSerializer() { + new RuntimeClientBuilder().withStateSerializer(null); + } + + @Test(expected = IllegalArgumentException.class) + public void noApiProtocal() { + new RuntimeClientBuilder().withApiProtocol(null); + } + +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/SayHelloTest.java b/sdk/src/test/java/io/mosn/layotto/v1/SayHelloTest.java new file mode 100644 index 0000000..1c1eeca --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/SayHelloTest.java @@ -0,0 +1,84 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import io.grpc.ManagedChannel; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import io.grpc.testing.GrpcCleanupRule; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.proto.runtime.v1.RuntimeProto; +import spec.sdk.runtime.v1.client.RuntimeClient; + +import static org.junit.Assert.assertEquals; +import static org.mockito.AdditionalAnswers.delegatesTo; +import static org.mockito.Mockito.mock; + +@RunWith(JUnit4.class) +public class SayHelloTest { + + @Rule + public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + + private final RuntimeGrpc.RuntimeImplBase serviceImpl = + mock(RuntimeGrpc.RuntimeImplBase.class, delegatesTo( + new RuntimeGrpc.RuntimeImplBase() { + @Override + public void sayHello(RuntimeProto.SayHelloRequest request, + io.grpc.stub.StreamObserver responseObserver) { + responseObserver.onNext( + RuntimeProto.SayHelloResponse + .newBuilder() + .setHello( + "hi, " + + request.getServiceName()) + .build()); + responseObserver.onCompleted(); + } + })); + + private RuntimeClient client; + + @Before + public void setUp() throws Exception { + // Generate a unique in-process server name. + String serverName = InProcessServerBuilder.generateName(); + + // Create a server, add service, start, and register for automatic graceful shutdown. + grpcCleanup.register(InProcessServerBuilder + .forName(serverName).directExecutor().addService(serviceImpl).build().start()); + + // Create a client channel and register for automatic graceful shutdown. + ManagedChannel channel = grpcCleanup.register( + InProcessChannelBuilder.forName(serverName).directExecutor().build()); + + // Create a HelloWorldClient using the in-process channel; + + client = new RuntimeClientBuilder() + .buildGrpcWithExistingChannel(channel); + } + + @Test + public void sayHello() { + String greet = client.sayHello("layotto"); + assertEquals("hi, layotto", greet); + } + +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/SayHelloTestWithRealServer.java b/sdk/src/test/java/io/mosn/layotto/v1/SayHelloTestWithRealServer.java new file mode 100644 index 0000000..a664f5a --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/SayHelloTestWithRealServer.java @@ -0,0 +1,73 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.mosn.layotto.v1.grpc.ExceptionHandler; +import io.mosn.layotto.v1.grpc.GrpcRuntimeClient; +import io.mosn.layotto.v1.mock.MyHelloService; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import spec.proto.runtime.v1.RuntimeGrpc; + +import static org.junit.Assert.assertEquals; + +@RunWith(JUnit4.class) +public class SayHelloTestWithRealServer { + + private RuntimeGrpc.RuntimeImplBase helloService = new MyHelloService(); + + private Server srv; + private GrpcRuntimeClient client; + + int port = 9999; + String ip = "127.0.0.1"; + + @Before + public void setUp() throws Exception { + // start grpc server + /* The port on which the server should run */ + srv = ServerBuilder.forPort(port) + .addService(helloService) + .intercept(new ExceptionHandler()) + .build() + .start(); + + // build a client + client = new RuntimeClientBuilder() + .withIp(ip) + .withPort(port) + .withConnectionPoolSize(4) + .withTimeout(2000) + .buildGrpc(); + } + + @After + public void shutdown() throws InterruptedException { + client.shutdown(); + srv.shutdownNow(); + } + + @Test + public void sayHello() { + String greet = client.sayHello("layotto"); + assertEquals("hi, layotto", greet); + } + +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/StateTest.java b/sdk/src/test/java/io/mosn/layotto/v1/StateTest.java new file mode 100644 index 0000000..3abf19f --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/StateTest.java @@ -0,0 +1,221 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import io.grpc.ManagedChannel; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import io.grpc.testing.GrpcCleanupRule; +import io.mosn.layotto.v1.mock.MyStateService; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.sdk.runtime.v1.client.RuntimeClient; +import spec.sdk.runtime.v1.domain.state.GetBulkStateRequest; +import spec.sdk.runtime.v1.domain.state.GetStateRequest; +import spec.sdk.runtime.v1.domain.state.State; +import spec.sdk.runtime.v1.domain.state.StateOptions; +import spec.sdk.runtime.v1.domain.state.TransactionalStateOperation; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static org.mockito.AdditionalAnswers.delegatesTo; +import static org.mockito.Mockito.mock; + +@RunWith(JUnit4.class) +public class StateTest { + @Rule + public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + + RuntimeGrpc.RuntimeImplBase stateService = new MyStateService(); + + private final RuntimeGrpc.RuntimeImplBase serviceImpl = + mock(RuntimeGrpc.RuntimeImplBase.class, + delegatesTo(stateService)); + + private RuntimeClient client; + + @Before + public void setUp() throws Exception { + String serverName = InProcessServerBuilder.generateName(); + grpcCleanup.register(InProcessServerBuilder + .forName(serverName).directExecutor() + .addService(serviceImpl) + .build().start()); + ManagedChannel channel = grpcCleanup.register( + InProcessChannelBuilder.forName(serverName).directExecutor().build()); + client = new RuntimeClientBuilder() + .buildGrpcWithExistingChannel(channel); + } + + @Test + public void testStateCrud() { + String storeName = "redis"; + + // saveState + client.saveState(storeName, "foo", "bar".getBytes()); + GetStateRequest req = new GetStateRequest(storeName, "foo"); + + // getState + State resp = client.getState(req, String.class); + Assert.assertEquals(resp.getValue(), "bar"); + + // delete + client.deleteState(storeName, "foo"); + + // getState + req = new GetStateRequest(storeName, "foo"); + resp = client.getState(req, String.class); + Assert.assertEquals(resp.getValue().length(), 0); + + // saveState + client.saveState(storeName, "key1", "bar1".getBytes()); + client.saveState(storeName, "key2", "bar2".getBytes()); + + GetBulkStateRequest br = new GetBulkStateRequest(storeName, Arrays.asList("key1", "key2")); + List> bulkResp = client.getBulkState(br, String.class); + Assert.assertEquals(bulkResp.get(0).getValue(), "bar1"); + Assert.assertEquals(bulkResp.get(1).getValue(), "bar2"); + + // deleteState + client.deleteState(storeName, "key1", null + , new StateOptions(StateOptions.Consistency.STRONG, StateOptions.Concurrency.FIRST_WRITE)); + client.deleteState(storeName, "key2", null + , new StateOptions(null, null)); + + br = new GetBulkStateRequest(storeName, Arrays.asList("key1", "key2")); + bulkResp = client.getBulkState(br, String.class); + Assert.assertEquals(bulkResp.get(0).getValue().length(), 0); + Assert.assertEquals(bulkResp.get(1).getValue().length(), 0); + } + + @Test + public void testTransaction() { + String storeName = "redis"; + String key1 = "key11"; + String key2 = "key22"; + String key3 = "key33"; + + // execute transaction + List> operationList = new ArrayList<>(); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key1, new TestClass(key1), ""))); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key2, new TestClass(key2), ""))); + client.executeStateTransaction(storeName, operationList); + + // getBulkState + List keys = new ArrayList<>(); + keys.add(key2); + keys.add(key1); + GetBulkStateRequest bulkReq = new GetBulkStateRequest(storeName, keys); + List> bulkState = client.getBulkState(bulkReq, TestClass.class); + Assert.assertTrue(bulkState.size() == 2); + for (State st : bulkState) { + String key = st.getKey(); + if (key.equals(key1)) { + Assert.assertEquals(st.getValue().getName(), key1); + } else if (key.equals(key2)) { + Assert.assertEquals(st.getValue().getName(), key2); + } else { + throw new RuntimeException("Unexpected key:" + key); + } + } + + // execute transaction,update key3 and delete key1 + operationList = new ArrayList<>(); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key3, new TestClass(key3), "", null + , new StateOptions(StateOptions.Consistency.STRONG, StateOptions.Concurrency.LAST_WRITE)))); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.DELETE, + new State<>(key2, new TestClass(key2), ""))); + client.executeStateTransaction(storeName, operationList); + + // getBulkState + keys = new ArrayList<>(); + keys.add(key2); + keys.add(key1); + keys.add(key3); + bulkReq = new GetBulkStateRequest(storeName, keys); + bulkState = client.getBulkState(bulkReq, TestClass.class); + Assert.assertTrue(bulkState.size() == 3); + for (State st : bulkState) { + String key = st.getKey(); + if (key.equals(key1)) { + Assert.assertEquals(st.getValue().getName(), key1); + } else if (key.equals(key2)) { + Assert.assertEquals(st.getValue(), null); + } else if (key.equals(key3)) { + Assert.assertEquals(st.getValue().getName(), key3); + } else { + throw new RuntimeException("Unexpected key:" + key); + } + } + } + + @Test(expected = IllegalArgumentException.class) + public void testTransactionNullOperation_thenIllegal() { + String storeName = "redis"; + String key1 = "key11"; + String key2 = "key22"; + + // execute transaction + List> operationList = new ArrayList<>(); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key1, new TestClass(key1), ""))); + // null + operationList.add(new TransactionalStateOperation<>(null, + new State<>(key2, new TestClass(key2), ""))); + client.executeStateTransaction(storeName, operationList); + } + + @Test(expected = IllegalArgumentException.class) + public void testTransactionEmptyKey_thenIllegal() { + String storeName = "redis"; + String key1 = ""; + String key2 = "key22"; + + // execute transaction + List> operationList = new ArrayList<>(); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key1, new TestClass(key1), ""))); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key2, new TestClass(key2), ""))); + client.executeStateTransaction(storeName, operationList); + } + + public static class TestClass { + String name; + + public TestClass(String name) { + this.name = name; + } + + /** + * Getter method for property name. + * + * @return property value of name + */ + public String getName() { + return name; + } + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/StateTestWithRealServer.java b/sdk/src/test/java/io/mosn/layotto/v1/StateTestWithRealServer.java new file mode 100644 index 0000000..0955f36 --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/StateTestWithRealServer.java @@ -0,0 +1,227 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import io.grpc.Server; +import io.grpc.ServerBuilder; +import io.mosn.layotto.v1.grpc.ExceptionHandler; +import io.mosn.layotto.v1.grpc.GrpcRuntimeClient; +import io.mosn.layotto.v1.mock.MyStateService; +import org.junit.After; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.sdk.runtime.v1.domain.state.GetBulkStateRequest; +import spec.sdk.runtime.v1.domain.state.GetStateRequest; +import spec.sdk.runtime.v1.domain.state.State; +import spec.sdk.runtime.v1.domain.state.StateOptions; +import spec.sdk.runtime.v1.domain.state.TransactionalStateOperation; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +@RunWith(JUnit4.class) +public class StateTestWithRealServer { + + private RuntimeGrpc.RuntimeImplBase stateService = new MyStateService(); + + private Server srv; + private GrpcRuntimeClient client; + + int port = 9999; + String ip = "127.0.0.1"; + + @Before + public void setUp() throws Exception { + // start grpc server + /* The port on which the server should run */ + srv = ServerBuilder.forPort(port) + .addService(stateService) + .intercept(new ExceptionHandler()) + .build() + .start(); + + // build a client + client = new RuntimeClientBuilder() + .withIp(ip) + .withPort(port) + .withConnectionPoolSize(4) + .withTimeout(1000) + .buildGrpc(); + } + + @After + public void shutdown() throws InterruptedException { + client.shutdown(); + srv.shutdownNow(); + } + + @Test + public void testStateCrud() { + String storeName = "redis"; + + // saveState + client.saveState(storeName, "foo", "bar".getBytes()); + GetStateRequest req = new GetStateRequest(storeName, "foo"); + + // getState + State resp = client.getState(req, String.class); + Assert.assertEquals(resp.getValue(), "bar"); + + // delete + client.deleteState(storeName, "foo"); + + // getState + req = new GetStateRequest(storeName, "foo"); + resp = client.getState(req, String.class); + Assert.assertEquals(resp.getValue().length(), 0); + + // saveState + client.saveState(storeName, "key1", "bar1".getBytes()); + client.saveState(storeName, "key2", "bar2".getBytes()); + + GetBulkStateRequest br = new GetBulkStateRequest(storeName, Arrays.asList("key1", "key2")); + List> bulkResp = client.getBulkState(br, String.class); + Assert.assertEquals(bulkResp.get(0).getValue(), "bar1"); + Assert.assertEquals(bulkResp.get(1).getValue(), "bar2"); + + // deleteState + client.deleteState(storeName, "key1", null + , new StateOptions(StateOptions.Consistency.STRONG, StateOptions.Concurrency.FIRST_WRITE)); + client.deleteState(storeName, "key2", null + , new StateOptions(null, null)); + + br = new GetBulkStateRequest(storeName, Arrays.asList("key1", "key2")); + bulkResp = client.getBulkState(br, String.class); + Assert.assertEquals(bulkResp.get(0).getValue().length(), 0); + Assert.assertEquals(bulkResp.get(1).getValue().length(), 0); + } + + @Test + public void testTransaction() { + String storeName = "redis"; + String key1 = "key11"; + String key2 = "key22"; + String key3 = "key33"; + + // execute transaction + List> operationList = new ArrayList<>(); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key1, new TestClass(key1), ""))); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key2, new TestClass(key2), ""))); + client.executeStateTransaction(storeName, operationList); + + // getBulkState + List keys = new ArrayList<>(); + keys.add(key2); + keys.add(key1); + GetBulkStateRequest bulkReq = new GetBulkStateRequest(storeName, keys); + List> bulkState = client.getBulkState(bulkReq, TestClass.class); + Assert.assertTrue(bulkState.size() == 2); + for (State st : bulkState) { + String key = st.getKey(); + if (key.equals(key1)) { + Assert.assertEquals(st.getValue().getName(), key1); + } else if (key.equals(key2)) { + Assert.assertEquals(st.getValue().getName(), key2); + } else { + throw new RuntimeException("Unexpected key:" + key); + } + } + + // execute transaction,update key3 and delete key1 + operationList = new ArrayList<>(); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key3, new TestClass(key3), "", null + , new StateOptions(StateOptions.Consistency.STRONG, StateOptions.Concurrency.LAST_WRITE)))); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.DELETE, + new State<>(key2, new TestClass(key2), ""))); + client.executeStateTransaction(storeName, operationList); + + // getBulkState + keys = new ArrayList<>(); + keys.add(key2); + keys.add(key1); + keys.add(key3); + bulkReq = new GetBulkStateRequest(storeName, keys); + bulkState = client.getBulkState(bulkReq, TestClass.class); + Assert.assertTrue(bulkState.size() == 3); + for (State st : bulkState) { + String key = st.getKey(); + if (key.equals(key1)) { + Assert.assertEquals(st.getValue().getName(), key1); + } else if (key.equals(key2)) { + Assert.assertEquals(st.getValue(), null); + } else if (key.equals(key3)) { + Assert.assertEquals(st.getValue().getName(), key3); + } else { + throw new RuntimeException("Unexpected key:" + key); + } + } + } + + @Test(expected = IllegalArgumentException.class) + public void testTransactionNullOperation_thenIllegal() { + String storeName = "redis"; + String key1 = "key11"; + String key2 = "key22"; + + // execute transaction + List> operationList = new ArrayList<>(); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key1, new TestClass(key1), ""))); + // null + operationList.add(new TransactionalStateOperation<>(null, + new State<>(key2, new TestClass(key2), ""))); + client.executeStateTransaction(storeName, operationList); + } + + @Test(expected = IllegalArgumentException.class) + public void testTransactionEmptyKey_thenIllegal() { + String storeName = "redis"; + String key1 = ""; + String key2 = "key22"; + + // execute transaction + List> operationList = new ArrayList<>(); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key1, new TestClass(key1), ""))); + operationList.add(new TransactionalStateOperation<>(TransactionalStateOperation.OperationType.UPSERT, + new State<>(key2, new TestClass(key2), ""))); + client.executeStateTransaction(storeName, operationList); + } + + public static class TestClass { + String name; + + public TestClass(String name) { + this.name = name; + } + + /** + * Getter method for property name. + * + * @return property value of name + */ + public String getName() { + return name; + } + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/SubscriberTest.java b/sdk/src/test/java/io/mosn/layotto/v1/SubscriberTest.java new file mode 100644 index 0000000..a3e6ec9 --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/SubscriberTest.java @@ -0,0 +1,141 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import io.grpc.inprocess.InProcessChannelBuilder; +import io.grpc.inprocess.InProcessServerBuilder; +import io.grpc.testing.GrpcCleanupRule; +import io.mosn.layotto.v1.callback.GrpcAppCallbackImpl; +import io.mosn.layotto.v1.callback.component.pubsub.SubscriberRegistry; +import io.mosn.layotto.v1.callback.component.pubsub.SubscriberRegistryImpl; +import io.mosn.layotto.v1.mock.MySubscriber; +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import spec.proto.runtime.v1.AppCallbackGrpc; +import spec.proto.runtime.v1.AppCallbackProto; + +import static org.junit.Assert.assertEquals; + +@RunWith(JUnit4.class) +public class SubscriberTest { + private final static String pubsubName = "redis"; + private final static String topic = "hello"; + + @Rule + public final GrpcCleanupRule grpcCleanup = new GrpcCleanupRule(); + + AppCallbackGrpc.AppCallbackBlockingStub blockingStub; + + @Before + public void setUp() throws Exception { + // Generate a unique in-process server name. + String serverName = InProcessServerBuilder.generateName(); + SubscriberRegistry sr = new SubscriberRegistryImpl(); + sr.registerPubSubCallback(pubsubName, new MySubscriber(pubsubName, topic)); + + // Create a server, add service, start, and register for automatic graceful shutdown. + grpcCleanup.register(InProcessServerBuilder + .forName(serverName).directExecutor().addService(new GrpcAppCallbackImpl(sr)).build().start()); + + // Create a client channel and register for automatic graceful shutdown. + blockingStub = AppCallbackGrpc.newBlockingStub( + grpcCleanup.register(InProcessChannelBuilder.forName(serverName).directExecutor().build())); + } + + @Test + public void listTopicSubscriptions() throws Exception { + AppCallbackProto.ListTopicSubscriptionsResponse subscriptionsResponse = blockingStub.listTopicSubscriptions( + Empty.getDefaultInstance()); + assertEquals(1, subscriptionsResponse.getSubscriptionsCount()); + assertEquals("hello", subscriptionsResponse.getSubscriptions(0).getTopic()); + } + + @Test + public void testOnEventSuccess() throws Exception { + //{ + // "contentType": "text/plain", + // "data": "d29ybGQ=", + // "id": "a31aa292-2703-4f29-be58-c1798e540619", + // "pubsubName": "redis", + // "source": "runtime", + // "specVersion": "1.0", + // "topic": "hello", + // "type": "com.runtime.event.sent" + //} + AppCallbackProto.TopicEventRequest req = AppCallbackProto.TopicEventRequest.newBuilder() + .setData(ByteString.copyFrom("d29ybGQ=".getBytes())) + .setId("a31aa292-2703-4f29-be58-c1798e540619") + .setPubsubName("redis") + .setSpecVersion("1.0") + .setTopic("hello") + .setType("com.runtime.event.sent") + .build(); + AppCallbackProto.TopicEventResponse resp = blockingStub.onTopicEvent(req); + assertEquals(resp.getStatusValue(), 0); + } + + @Test + public void whenOnEventPubsubNameWrong_thenDrop() throws Exception { + //{ + // "contentType": "text/plain", + // "data": "d29ybGQ=", + // "id": "a31aa292-2703-4f29-be58-c1798e540619", + // "pubsubName": "redis", + // "source": "runtime", + // "specVersion": "1.0", + // "topic": "hello1", + // "type": "com.runtime.event.sent" + //} + AppCallbackProto.TopicEventRequest req = AppCallbackProto.TopicEventRequest.newBuilder() + .setData(ByteString.copyFrom("d29ybGQ=".getBytes())) + .setId("a31aa292-2703-4f29-be58-c1798e540619") + .setPubsubName("redis") + .setSpecVersion("1.0") + .setTopic("hello1") + .setType("com.runtime.event.sent") + .build(); + AppCallbackProto.TopicEventResponse resp = blockingStub.onTopicEvent(req); + assertEquals(resp.getStatusValue(), 2); + } + + @Test(expected = io.grpc.StatusRuntimeException.class) + public void whenOnEventTopicWrong_thenError() throws Exception { + //{ + // "contentType": "text/plain", + // "data": "d29ybGQ=", + // "id": "a31aa292-2703-4f29-be58-c1798e540619", + // "pubsubName": "redis1", + // "source": "runtime", + // "specVersion": "1.0", + // "topic": "hello", + // "type": "com.runtime.event.sent" + //} + AppCallbackProto.TopicEventRequest req = AppCallbackProto.TopicEventRequest.newBuilder() + .setData(ByteString.copyFrom("d29ybGQ=".getBytes())) + .setId("a31aa292-2703-4f29-be58-c1798e540619") + .setPubsubName("redis1") + .setSpecVersion("1.0") + .setTopic("hello") + .setType("com.runtime.event.sent") + .build(); + AppCallbackProto.TopicEventResponse resp = blockingStub.onTopicEvent(req); + assertEquals(resp.getStatusValue(), 2); + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/SubscriberTestWithRealServer.java b/sdk/src/test/java/io/mosn/layotto/v1/SubscriberTestWithRealServer.java new file mode 100644 index 0000000..e28b224 --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/SubscriberTestWithRealServer.java @@ -0,0 +1,139 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1; + +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import io.grpc.ManagedChannel; +import io.grpc.ManagedChannelBuilder; +import io.mosn.layotto.v1.mock.MySubscriber; +import org.junit.After; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; +import spec.proto.runtime.v1.AppCallbackGrpc; +import spec.proto.runtime.v1.AppCallbackProto; + +import static org.junit.Assert.assertEquals; + +@RunWith(JUnit4.class) +public class SubscriberTestWithRealServer { + private final static String pubsubName = "redis"; + private final static String topic = "hello"; + + AppCallbackGrpc.AppCallbackBlockingStub blockingStub; + RuntimeServerGrpc server; + int port = 7777; + String ip = "127.0.0.1"; + + @Before + public void setUp() throws Exception { + server = new RuntimeServerGrpc(port); + server.registerPubSubCallback(pubsubName, new MySubscriber(pubsubName, topic)); + server.start(); + + // build a client + ManagedChannel channel = ManagedChannelBuilder.forAddress(ip, port) + .usePlaintext() + .build(); + blockingStub = AppCallbackGrpc.newBlockingStub(channel); + } + + @After + public void shutdown() throws InterruptedException { + server.stop(); + } + + @Test + public void listTopicSubscriptions() throws Exception { + AppCallbackProto.ListTopicSubscriptionsResponse subscriptionsResponse = blockingStub.listTopicSubscriptions( + Empty.getDefaultInstance()); + assertEquals(1, subscriptionsResponse.getSubscriptionsCount()); + assertEquals("hello", subscriptionsResponse.getSubscriptions(0).getTopic()); + } + + @Test + public void testOnEventSuccess() throws Exception { + //{ + // "contentType": "text/plain", + // "data": "d29ybGQ=", + // "id": "a31aa292-2703-4f29-be58-c1798e540619", + // "pubsubName": "redis", + // "source": "runtime", + // "specVersion": "1.0", + // "topic": "hello", + // "type": "com.runtime.event.sent" + //} + AppCallbackProto.TopicEventRequest req = AppCallbackProto.TopicEventRequest.newBuilder() + .setData(ByteString.copyFrom("d29ybGQ=".getBytes())) + .setId("a31aa292-2703-4f29-be58-c1798e540619") + .setPubsubName("redis") + .setSpecVersion("1.0") + .setTopic("hello") + .setType("com.runtime.event.sent") + .build(); + AppCallbackProto.TopicEventResponse resp = blockingStub.onTopicEvent(req); + assertEquals(resp.getStatusValue(), 0); + } + + @Test + public void whenOnEventPubsubNameWrong_thenDrop() throws Exception { + //{ + // "contentType": "text/plain", + // "data": "d29ybGQ=", + // "id": "a31aa292-2703-4f29-be58-c1798e540619", + // "pubsubName": "redis", + // "source": "runtime", + // "specVersion": "1.0", + // "topic": "hello1", + // "type": "com.runtime.event.sent" + //} + AppCallbackProto.TopicEventRequest req = AppCallbackProto.TopicEventRequest.newBuilder() + .setData(ByteString.copyFrom("d29ybGQ=".getBytes())) + .setId("a31aa292-2703-4f29-be58-c1798e540619") + .setPubsubName("redis") + .setSpecVersion("1.0") + .setTopic("hello1") + .setType("com.runtime.event.sent") + .build(); + AppCallbackProto.TopicEventResponse resp = blockingStub.onTopicEvent(req); + assertEquals(resp.getStatusValue(), 2); + } + + @Test(expected = io.grpc.StatusRuntimeException.class) + public void whenOnEventTopicWrong_thenError() throws Exception { + //{ + // "contentType": "text/plain", + // "data": "d29ybGQ=", + // "id": "a31aa292-2703-4f29-be58-c1798e540619", + // "pubsubName": "redis1", + // "source": "runtime", + // "specVersion": "1.0", + // "topic": "hello", + // "type": "com.runtime.event.sent" + //} + AppCallbackProto.TopicEventRequest req = AppCallbackProto.TopicEventRequest.newBuilder() + .setData(ByteString.copyFrom("d29ybGQ=".getBytes())) + .setId("a31aa292-2703-4f29-be58-c1798e540619") + .setPubsubName("redis1") + .setSpecVersion("1.0") + .setTopic("hello") + .setType("com.runtime.event.sent") + .build(); + AppCallbackProto.TopicEventResponse resp = blockingStub.onTopicEvent(req); + assertEquals(resp.getStatusValue(), 2); + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/grpc/stub/RRPoolTest.java b/sdk/src/test/java/io/mosn/layotto/v1/grpc/stub/RRPoolTest.java new file mode 100644 index 0000000..ed78643 --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/grpc/stub/RRPoolTest.java @@ -0,0 +1,52 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.grpc.stub; + +import org.junit.Assert; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.junit.runners.JUnit4; + +@RunWith(JUnit4.class) +public class RRPoolTest { + + @Test + public void testRR() { + RRPool.RRIndex idx = new RRPool.RRIndex(1); + Assert.assertEquals(0, idx.next()); + Assert.assertEquals(0, idx.next()); + Assert.assertEquals(0, idx.next()); + + int count = 32; + idx = new RRPool.RRIndex(count); + for (int i = 0; i < count; i++) { + Assert.assertEquals(i, idx.next()); + } + for (int i = 0; i < count; i++) { + Assert.assertEquals(i, idx.next()); + } + for (int i = 0; i < count; i++) { + Assert.assertEquals(i, idx.next()); + } + } + + @Test + public void testRROverflow() { + RRPool.RRIndex idx = new RRPool.RRIndex(Integer.MAX_VALUE, 10); + Assert.assertEquals(0, idx.next()); + Assert.assertEquals(1, idx.next()); + Assert.assertEquals(2, idx.next()); + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/mock/MyFileService.java b/sdk/src/test/java/io/mosn/layotto/v1/mock/MyFileService.java new file mode 100644 index 0000000..106423c --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/mock/MyFileService.java @@ -0,0 +1,143 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.mock; + +import com.google.protobuf.ByteString; +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.proto.runtime.v1.RuntimeProto; + +public class MyFileService extends RuntimeGrpc.RuntimeImplBase { + + @Override + public StreamObserver putFile(StreamObserver responseObserver) { + + return new StreamObserver() { + + @Override + public void onNext(RuntimeProto.PutFileRequest putFileRequest) { + + String log = String.format("put file store name %s, meta %d, file name %s, data size %d", + putFileRequest.getStoreName(), + putFileRequest.getMetadataCount(), + putFileRequest.getName(), + putFileRequest.getData().size()); + + System.out.println(log); + } + + @Override + public void onError(Throwable throwable) { + if (throwable != null) { + System.err.println("put file err: " + throwable); + } + } + + @Override + public void onCompleted() { + System.out.println("finished put file"); + responseObserver.onNext(Empty.newBuilder().build()); + responseObserver.onCompleted(); + } + }; + } + + @Override + public void getFile(RuntimeProto.GetFileRequest request, + StreamObserver responseObserver) { + + String echo = String.format("get file store name %s, meta %d, file name %s", + request.getStoreName(), + request.getMetadataCount(), + request.getName()); + + responseObserver.onNext( + RuntimeProto.GetFileResponse.newBuilder(). + setData( + ByteString.copyFrom(echo.getBytes())). + build()); + + responseObserver.onCompleted(); + } + + @Override + public void delFile(RuntimeProto.DelFileRequest request, StreamObserver responseObserver) { + + String log = String.format("del file store name %s, meta %d, file name %s", + request.getRequest().getStoreName(), + request.getRequest().getMetadataCount(), + request.getRequest().getName()); + + System.out.println(log); + + responseObserver.onNext(Empty.newBuilder().build()); + responseObserver.onCompleted(); + } + + @Override + public void listFile(RuntimeProto.ListFileRequest request, + StreamObserver responseObserver) { + + String echo = String.format("put file store name %s, meta %d", + request.getRequest().getStoreName(), + request.getRequest().getMetadataCount()); + + responseObserver.onNext( + RuntimeProto.ListFileResp.newBuilder(). + addFiles( + RuntimeProto.FileInfo.newBuilder(). + setFileName(echo). + setSize(100). + setLastModified("2021-11-23 10:24:11"). + putMetadata("k1", "v1"). + build()). + setMarker("marker"). + setIsTruncated(true). + build() + ); + + responseObserver.onCompleted(); + } + + @Override + public void getFileMeta(RuntimeProto.GetFileMetaRequest request, + StreamObserver responseObserver) { + + String log = String.format("get file meta store name %s, meta %d, file name %s", + request.getRequest().getStoreName(), + request.getRequest().getMetadataCount(), + request.getRequest().getName()); + + System.out.println(log); + + responseObserver.onNext( + RuntimeProto.GetFileMetaResponse.newBuilder(). + setSize(100). + setLastModified("2021-11-22 10:24:11"). + setResponse( + RuntimeProto.FileMeta.newBuilder(). + putMetadata( + "k1", + RuntimeProto.FileMetaValue.newBuilder(). + addValue("v1"). + addValue("v2"). + build()). + build()). + build()); + + responseObserver.onCompleted(); + } +} diff --git a/sdk/src/test/java/io/mosn/layotto/v1/mock/MyHelloService.java b/sdk/src/test/java/io/mosn/layotto/v1/mock/MyHelloService.java new file mode 100644 index 0000000..543b23c --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/mock/MyHelloService.java @@ -0,0 +1,32 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.mock; + +import io.grpc.stub.StreamObserver; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.proto.runtime.v1.RuntimeProto; + +public class MyHelloService extends RuntimeGrpc.RuntimeImplBase { + + @Override + public void sayHello(RuntimeProto.SayHelloRequest request, + StreamObserver responseObserver) { + + RuntimeProto.SayHelloResponse resp = RuntimeProto.SayHelloResponse.newBuilder() + .setHello("hi, " + request.getServiceName()).build(); + responseObserver.onNext(resp); + responseObserver.onCompleted(); + } +} \ No newline at end of file diff --git a/sdk/src/test/java/io/mosn/layotto/v1/mock/MyPublishService.java b/sdk/src/test/java/io/mosn/layotto/v1/mock/MyPublishService.java new file mode 100644 index 0000000..f22190b --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/mock/MyPublishService.java @@ -0,0 +1,40 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.mock; + +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.proto.runtime.v1.RuntimeProto; + +public class MyPublishService extends RuntimeGrpc.RuntimeImplBase { + RuntimeProto.PublishEventRequest lastReq = null; + + @Override + public void publishEvent(RuntimeProto.PublishEventRequest request, StreamObserver responseObserver) { + lastReq = request; + responseObserver.onNext(null); + responseObserver.onCompleted(); + } + + /** + * Getter method for property lastReq. + * + * @return property value of lastReq + */ + public RuntimeProto.PublishEventRequest getLastReq() { + return lastReq; + } +} \ No newline at end of file diff --git a/sdk/src/test/java/io/mosn/layotto/v1/mock/MyStateService.java b/sdk/src/test/java/io/mosn/layotto/v1/mock/MyStateService.java new file mode 100644 index 0000000..8688a3c --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/mock/MyStateService.java @@ -0,0 +1,116 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.mock; + +import com.google.protobuf.Empty; +import io.grpc.stub.StreamObserver; +import spec.proto.runtime.v1.RuntimeGrpc; +import spec.proto.runtime.v1.RuntimeProto; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MyStateService extends RuntimeGrpc.RuntimeImplBase { + private Map store = new HashMap<>(); + + @Override + public void getState(RuntimeProto.GetStateRequest request, + StreamObserver responseObserver) { + RuntimeProto.StateItem item = store.get(request.getKey()); + if (item == null) { + responseObserver.onNext(null); + responseObserver.onCompleted(); + return; + } + RuntimeProto.GetStateResponse resp = RuntimeProto.GetStateResponse.newBuilder() + .setData(item.getValue()) + .setEtag(item.getEtag().getValue()) + .putAllMetadata(item.getMetadataMap()) + .build(); + responseObserver.onNext(resp); + responseObserver.onCompleted(); + } + + @Override + public void getBulkState(RuntimeProto.GetBulkStateRequest request, + StreamObserver responseObserver) { + RuntimeProto.GetBulkStateResponse.Builder builder = RuntimeProto.GetBulkStateResponse.newBuilder(); + for (int i = 0; i < request.getKeysCount(); i++) { + RuntimeProto.BulkStateItem.Builder itemBuilder = RuntimeProto.BulkStateItem.newBuilder().setKey( + request.getKeys(i)); + RuntimeProto.StateItem item = store.get(request.getKeys(i)); + if (item != null) { + itemBuilder = itemBuilder.setData(item.getValue()).setEtag(item.getEtag().getValue()).putAllMetadata( + item.getMetadataMap()); + } + + builder = builder.addItems(itemBuilder.build()); + } + responseObserver.onNext(builder.build()); + responseObserver.onCompleted(); + } + + @Override + public void saveState(RuntimeProto.SaveStateRequest request, StreamObserver responseObserver) { + for (int i = 0; i < request.getStatesCount(); i++) { + store.put(request.getStates(i).getKey(), request.getStates(i)); + } + responseObserver.onNext(null); + responseObserver.onCompleted(); + } + + @Override + public void deleteState(RuntimeProto.DeleteStateRequest request, StreamObserver responseObserver) { + store.remove(request.getKey()); + responseObserver.onNext(null); + responseObserver.onCompleted(); + } + + @Override + public void deleteBulkState(RuntimeProto.DeleteBulkStateRequest request, StreamObserver responseObserver) { + for (int i = 0; i < request.getStatesCount(); i++) { + store.remove(request.getStates(i).getKey()); + } + responseObserver.onNext(null); + responseObserver.onCompleted(); + } + + @Override + public void executeStateTransaction(RuntimeProto.ExecuteStateTransactionRequest request, + StreamObserver responseObserver) { + List list = request.getOperationsList(); + Map newStore = new HashMap<>(store); + try { + for (RuntimeProto.TransactionalStateOperation tso : list) { + String type = tso.getOperationType(); + RuntimeProto.StateItem req = tso.getRequest(); + if ("upsert".equals(type)) { + newStore.put(req.getKey(), req); + } else if ("delete".equals(type)) { + newStore.remove(req.getKey()); + } else { + throw new RuntimeException("illegal type" + type); + } + } + store = newStore; + responseObserver.onNext(null); + responseObserver.onCompleted(); + } catch (Exception e) { + responseObserver.onError(e); + responseObserver.onCompleted(); + } + } +} \ No newline at end of file diff --git a/sdk/src/test/java/io/mosn/layotto/v1/mock/MySubscriber.java b/sdk/src/test/java/io/mosn/layotto/v1/mock/MySubscriber.java new file mode 100644 index 0000000..a3e8343 --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/mock/MySubscriber.java @@ -0,0 +1,62 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package io.mosn.layotto.v1.mock; + +import io.mosn.layotto.v1.callback.component.pubsub.Subscriber; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventRequest; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventResponse; +import spec.sdk.runtime.v1.domain.pubsub.TopicEventResponseStatus; +import spec.sdk.runtime.v1.domain.pubsub.TopicSubscription; + +import java.util.HashSet; +import java.util.Set; + +public class MySubscriber implements Subscriber { + private final String pubsubName; + private final String topic; + + public MySubscriber(String pubsubName, String topic) { + this.pubsubName = pubsubName; + this.topic = topic; + } + + @Override + public Set listTopicSubscriptions() { + TopicSubscription topicSub = new TopicSubscription(); + topicSub.setPubsubName(pubsubName); + topicSub.setTopic(topic); + Set set = new HashSet<>(); + set.add(topicSub); + return set; + } + + @Override + public TopicEventResponse onTopicEvent(TopicEventRequest request) { + TopicEventResponse resp = new TopicEventResponse(); + resp.setStatus(TopicEventResponseStatus.SUCCESS); + if (!topic.equals(request.getTopic())) { + resp.setStatus(TopicEventResponseStatus.DROP); + } + if (!pubsubName.equals(request.getPubsubName())) { + resp.setStatus(TopicEventResponseStatus.DROP); + } + return resp; + } + + @Override + public String getComponentName() { + return "redis"; + } +} \ No newline at end of file diff --git a/sdk/src/test/java/io/mosn/layotto/v1/serializer/JSONSerializerTest.java b/sdk/src/test/java/io/mosn/layotto/v1/serializer/JSONSerializerTest.java new file mode 100644 index 0000000..4a1b555 --- /dev/null +++ b/sdk/src/test/java/io/mosn/layotto/v1/serializer/JSONSerializerTest.java @@ -0,0 +1,464 @@ +/* + * Copyright 2021 Layotto Authors + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +// CODE ATTRIBUTION: https://github.com/dapr/java-sdk +// Modified some test cases to test layotto's code +package io.mosn.layotto.v1.serializer; + +import org.junit.Assert; +import org.junit.Test; + +import java.io.IOException; +import java.io.Serializable; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.fail; + +public class JSONSerializerTest { + + private static final ObjectSerializer SERIALIZER = new JSONSerializer(); + + @Test + public void getContentType() { + assertEquals(new JSONSerializer().getContentType(), "application/json"); + } + + public static class MyObjectTestToSerialize implements Serializable { + private String stringValue; + private int intValue; + private boolean boolValue; + private char charValue; + private byte byteValue; + private short shortValue; + private long longValue; + private float floatValue; + private double doubleValue; + + public String getStringValue() { + return stringValue; + } + + public void setStringValue(String stringValue) { + this.stringValue = stringValue; + } + + public int getIntValue() { + return intValue; + } + + public void setIntValue(int intValue) { + this.intValue = intValue; + } + + public boolean isBoolValue() { + return boolValue; + } + + public void setBoolValue(boolean boolValue) { + this.boolValue = boolValue; + } + + public char getCharValue() { + return charValue; + } + + public void setCharValue(char charValue) { + this.charValue = charValue; + } + + public byte getByteValue() { + return byteValue; + } + + public void setByteValue(byte byteValue) { + this.byteValue = byteValue; + } + + public short getShortValue() { + return shortValue; + } + + public void setShortValue(short shortValue) { + this.shortValue = shortValue; + } + + public long getLongValue() { + return longValue; + } + + public void setLongValue(long longValue) { + this.longValue = longValue; + } + + public float getFloatValue() { + return floatValue; + } + + public void setFloatValue(float floatValue) { + this.floatValue = floatValue; + } + + public double getDoubleValue() { + return doubleValue; + } + + public void setDoubleValue(double doubleValue) { + this.doubleValue = doubleValue; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof MyObjectTestToSerialize)) { + return false; + } + + MyObjectTestToSerialize that = (MyObjectTestToSerialize) o; + + if (getIntValue() != that.getIntValue()) { + return false; + } + if (isBoolValue() != that.isBoolValue()) { + return false; + } + if (getCharValue() != that.getCharValue()) { + return false; + } + if (getByteValue() != that.getByteValue()) { + return false; + } + if (getShortValue() != that.getShortValue()) { + return false; + } + if (getLongValue() != that.getLongValue()) { + return false; + } + if (Float.compare(that.getFloatValue(), getFloatValue()) != 0) { + return false; + } + if (Double.compare(that.getDoubleValue(), getDoubleValue()) != 0) { + return false; + } + if (getStringValue() != null ? !getStringValue().equals(that.getStringValue()) + : that.getStringValue() != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result; + long temp; + result = getStringValue() != null ? getStringValue().hashCode() : 0; + result = 31 * result + getIntValue(); + result = 31 * result + (isBoolValue() ? 1 : 0); + result = 31 * result + (int) getCharValue(); + result = 31 * result + (int) getByteValue(); + result = 31 * result + (int) getShortValue(); + result = 31 * result + (int) (getLongValue() ^ (getLongValue() >>> 32)); + result = 31 * result + (getFloatValue() != +0.0f ? Float.floatToIntBits(getFloatValue()) : 0); + temp = Double.doubleToLongBits(getDoubleValue()); + result = 31 * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + @Override + public String toString() { + return "MyObjectTestToSerialize{" + + "stringValue='" + stringValue + '\'' + + ", intValue=" + intValue + + ", boolValue=" + boolValue + + ", charValue=" + charValue + + ", byteValue=" + byteValue + + ", shortValue=" + shortValue + + ", longValue=" + longValue + + ", floatValue=" + floatValue + + ", doubleValue=" + doubleValue + + '}'; + } + } + + @Test + public void serializeStringObjectTest() { + MyObjectTestToSerialize obj = new MyObjectTestToSerialize(); + obj.setStringValue("A String"); + obj.setIntValue(2147483647); + obj.setBoolValue(true); + obj.setCharValue('a'); + obj.setByteValue((byte) 65); + obj.setShortValue((short) 32767); + obj.setLongValue(9223372036854775807L); + obj.setFloatValue(1.0f); + obj.setDoubleValue(1000.0); + String expectedResult = "{\"boolValue\":true,\"byteValue\":65,\"charValue\":\"a\",\"doubleValue\":1000.0,\"floatValue\":1.0," + + "\"intValue\":2147483647,\"longValue\":9223372036854775807,\"shortValue\":32767,\"stringValue\":\"A String\"}"; + + String serializedValue; + try { + serializedValue = new String(SERIALIZER.serialize(obj)); + assertEquals("FOUND:[[" + serializedValue + "]] \n but was EXPECTING: [[" + expectedResult + "]]", + expectedResult, + serializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + + @Test + public void serializeObjectTest() { + MyObjectTestToSerialize obj = new MyObjectTestToSerialize(); + obj.setStringValue("A String"); + obj.setIntValue(2147483647); + obj.setBoolValue(true); + obj.setCharValue('a'); + obj.setByteValue((byte) 65); + obj.setShortValue((short) 32767); + obj.setLongValue(9223372036854775807L); + obj.setFloatValue(1.0f); + obj.setDoubleValue(1000.0); + //String expectedResult = "{\"stringValue\":\"A String\",\"intValue\":2147483647,\"boolValue\":true,\"charValue\":\"a\", + // \"byteValue\":65,\"shortValue\":32767,\"longValue\":9223372036854775807,\"floatValue\":1.0,\"doubleValue\":1000.0}"; + + byte[] serializedValue; + try { + serializedValue = SERIALIZER.serialize(obj); + Assert.assertNotNull(serializedValue); + MyObjectTestToSerialize deserializedValue = SERIALIZER.deserialize(serializedValue, + MyObjectTestToSerialize.class); + assertEquals(obj, deserializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + + try { + serializedValue = SERIALIZER.serialize(obj); + Assert.assertNotNull(serializedValue); + MyObjectTestToSerialize deserializedValue = SERIALIZER.deserialize(serializedValue, + MyObjectTestToSerialize.class); + assertEquals(obj, deserializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + + @Test + public void serializeNullTest() { + + byte[] byteSerializedValue; + try { + byteSerializedValue = SERIALIZER.serialize(null); + Assert.assertNull(byteSerializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + + @Test + public void serializeEmptyByteArrayTest() { + + byte[] byteSerializedValue; + try { + byteSerializedValue = SERIALIZER.serialize(new byte[] {}); + Assert.assertTrue(byteSerializedValue != null && byteSerializedValue.length == 0); + } catch (IOException exception) { + fail(exception.getMessage()); + } + try { + byteSerializedValue = SERIALIZER.deserialize(null, byte[].class); + Assert.assertNull(byteSerializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + try { + byteSerializedValue = SERIALIZER.deserialize(new byte[] {}, byte[].class); + Assert.assertTrue(byteSerializedValue != null && byteSerializedValue.length == 0); + } catch (IOException exception) { + fail(exception.getMessage()); + } + try { + MyObjectTestToSerialize de = SERIALIZER.deserialize(new byte[] {}, MyObjectTestToSerialize.class); + Assert.assertNull(de); + } catch (IOException exception) { + fail(exception.getMessage()); + } + try { + MyObjectTestToSerialize de = SERIALIZER.deserialize(null, MyObjectTestToSerialize.class); + Assert.assertNull(de); + } catch (IOException exception) { + fail(exception.getMessage()); + } + + } + + @Test + public void serializeStringTest() { + String valueToSerialize = "A String"; + + String serializedValue; + byte[] byteValue; + try { + serializedValue = new String(SERIALIZER.serialize(valueToSerialize)); + assertEquals(valueToSerialize, serializedValue); + byteValue = SERIALIZER.serialize(valueToSerialize); + Assert.assertNotNull(byteValue); + String deserializedValue = SERIALIZER.deserialize(byteValue, String.class); + assertEquals(valueToSerialize, deserializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + + @Test + public void serializeIntTest() { + Integer valueToSerialize = 1; + String expectedResult = valueToSerialize.toString(); + + String serializedValue; + byte[] byteValue; + try { + serializedValue = new String(SERIALIZER.serialize(valueToSerialize.intValue())); + assertEquals(expectedResult, serializedValue); + byteValue = SERIALIZER.serialize(valueToSerialize); + Assert.assertNotNull(byteValue); + Integer deserializedValue = SERIALIZER.deserialize(byteValue, Integer.class); + assertEquals(valueToSerialize, deserializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + + @Test + public void serializeShortTest() { + Short valueToSerialize = 1; + String expectedResult = valueToSerialize.toString(); + + String serializedValue; + byte[] byteValue; + try { + serializedValue = new String(SERIALIZER.serialize(valueToSerialize.shortValue())); + assertEquals(expectedResult, serializedValue); + byteValue = SERIALIZER.serialize(valueToSerialize); + Assert.assertNotNull(byteValue); + Short deserializedValue = SERIALIZER.deserialize(byteValue, Short.class); + assertEquals(valueToSerialize, deserializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + + @Test + public void serializeLongTest() { + Long valueToSerialize = Long.MAX_VALUE; + String expectedResult = valueToSerialize.toString(); + + String serializedValue; + byte[] byteValue; + try { + serializedValue = new String(SERIALIZER.serialize(valueToSerialize.longValue())); + assertEquals(expectedResult, serializedValue); + byteValue = SERIALIZER.serialize(valueToSerialize); + Assert.assertNotNull(byteValue); + Long deserializedValue = SERIALIZER.deserialize(byteValue, Long.class); + assertEquals(valueToSerialize, deserializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + + @Test + public void serializeFloatTest() { + Float valueToSerialize = -1.23456f; + String expectedResult = valueToSerialize.toString(); + + String serializedValue; + byte[] byteValue; + try { + serializedValue = new String(SERIALIZER.serialize(valueToSerialize.floatValue())); + assertEquals(expectedResult, serializedValue); + byteValue = SERIALIZER.serialize(valueToSerialize); + Assert.assertNotNull(byteValue); + Float deserializedValue = SERIALIZER.deserialize(byteValue, Float.class); + assertEquals(valueToSerialize, deserializedValue, 0.00000000001); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + + @Test + public void serializeDoubleTest() { + Double valueToSerialize = 1.0; + String expectedResult = valueToSerialize.toString(); + + String serializedValue; + byte[] byteValue; + try { + serializedValue = new String(SERIALIZER.serialize(valueToSerialize.doubleValue())); + assertEquals(expectedResult, serializedValue); + byteValue = SERIALIZER.serialize(valueToSerialize); + Assert.assertNotNull(byteValue); + Double deserializedValue = SERIALIZER.deserialize(byteValue, Double.class); + assertEquals(valueToSerialize, deserializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + + @Test + public void serializeBooleanTest() { + Boolean valueToSerialize = true; + String expectedResult = valueToSerialize.toString(); + + String serializedValue; + byte[] byteValue; + try { + serializedValue = new String(SERIALIZER.serialize(valueToSerialize.booleanValue())); + assertEquals(expectedResult, serializedValue); + byteValue = SERIALIZER.serialize(valueToSerialize); + Assert.assertNotNull(byteValue); + Boolean deserializedValue = SERIALIZER.deserialize(byteValue, Boolean.class); + assertEquals(valueToSerialize, deserializedValue); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + + @Test + public void deserializeObjectTest() { + String jsonToDeserialize = "{\"stringValue\":\"A String\",\"intValue\":2147483647,\"boolValue\":true,\"charValue\":\"a\",\"byteValue\":65," + + "\"shortValue\":32767,\"longValue\":9223372036854775807,\"floatValue\":1.0,\"doubleValue\":1000.0}"; + MyObjectTestToSerialize expectedResult = new MyObjectTestToSerialize(); + expectedResult.setStringValue("A String"); + expectedResult.setIntValue(2147483647); + expectedResult.setBoolValue(true); + expectedResult.setCharValue('a'); + expectedResult.setByteValue((byte) 65); + expectedResult.setShortValue((short) 32767); + expectedResult.setLongValue(9223372036854775807L); + expectedResult.setFloatValue(1.0f); + expectedResult.setDoubleValue(1000.0); + MyObjectTestToSerialize result; + + try { + result = SERIALIZER.deserialize(jsonToDeserialize.getBytes(), MyObjectTestToSerialize.class); + assertEquals("The expected value is different than the actual result", expectedResult, result); + } catch (IOException exception) { + fail(exception.getMessage()); + } + } + +} diff --git a/spec/pom.xml b/spec/pom.xml new file mode 100644 index 0000000..5eed022 --- /dev/null +++ b/spec/pom.xml @@ -0,0 +1,101 @@ + + + 4.0.0 + + + io.mosn.layotto + runtime-sdk-parent + 1.1.0-SNAPSHOT + + + runtime-spec-pb + runtime-spec-pb + jar + + + + io.grpc + grpc-all + + + + + src/main/java + + + src/main/resources + true + + **/** + + + + proto + true + + **/*.proto + + + + + src/test/java + + + src/test/resources + true + + **/** + + + + + + + kr.motd.maven + os-maven-plugin + 1.4.1.Final + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.apache.maven.plugins + maven-source-plugin + 3.0.1 + + + attach-sources + + jar + + + + + + + + \ No newline at end of file diff --git a/spec/src/main/java/spec/proto/runtime/v1/AppCallbackGrpc.java b/spec/src/main/java/spec/proto/runtime/v1/AppCallbackGrpc.java new file mode 100644 index 0000000..33bc7b9 --- /dev/null +++ b/spec/src/main/java/spec/proto/runtime/v1/AppCallbackGrpc.java @@ -0,0 +1,411 @@ +package spec.proto.runtime.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + *
+ * AppCallback V1 allows user application to interact with runtime.
+ * User application needs to implement AppCallback service if it needs to
+ * receive message from runtime.
+ * 
+ */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.34.1)", + comments = "Source: proto/runtime/v1/appcallback.proto") +public final class AppCallbackGrpc { + + private AppCallbackGrpc() {} + + public static final String SERVICE_NAME = "spec.proto.runtime.v1.AppCallback"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getListTopicSubscriptionsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListTopicSubscriptions", + requestType = com.google.protobuf.Empty.class, + responseType = spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListTopicSubscriptionsMethod() { + io.grpc.MethodDescriptor getListTopicSubscriptionsMethod; + if ((getListTopicSubscriptionsMethod = AppCallbackGrpc.getListTopicSubscriptionsMethod) == null) { + synchronized (AppCallbackGrpc.class) { + if ((getListTopicSubscriptionsMethod = AppCallbackGrpc.getListTopicSubscriptionsMethod) == null) { + AppCallbackGrpc.getListTopicSubscriptionsMethod = getListTopicSubscriptionsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListTopicSubscriptions")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse.getDefaultInstance())) + .setSchemaDescriptor(new AppCallbackMethodDescriptorSupplier("ListTopicSubscriptions")) + .build(); + } + } + } + return getListTopicSubscriptionsMethod; + } + + private static volatile io.grpc.MethodDescriptor getOnTopicEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "OnTopicEvent", + requestType = spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest.class, + responseType = spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getOnTopicEventMethod() { + io.grpc.MethodDescriptor getOnTopicEventMethod; + if ((getOnTopicEventMethod = AppCallbackGrpc.getOnTopicEventMethod) == null) { + synchronized (AppCallbackGrpc.class) { + if ((getOnTopicEventMethod = AppCallbackGrpc.getOnTopicEventMethod) == null) { + AppCallbackGrpc.getOnTopicEventMethod = getOnTopicEventMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "OnTopicEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.getDefaultInstance())) + .setSchemaDescriptor(new AppCallbackMethodDescriptorSupplier("OnTopicEvent")) + .build(); + } + } + } + return getOnTopicEventMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static AppCallbackStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppCallbackStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppCallbackStub(channel, callOptions); + } + }; + return AppCallbackStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static AppCallbackBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppCallbackBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppCallbackBlockingStub(channel, callOptions); + } + }; + return AppCallbackBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static AppCallbackFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public AppCallbackFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppCallbackFutureStub(channel, callOptions); + } + }; + return AppCallbackFutureStub.newStub(factory, channel); + } + + /** + *
+   * AppCallback V1 allows user application to interact with runtime.
+   * User application needs to implement AppCallback service if it needs to
+   * receive message from runtime.
+   * 
+ */ + public static abstract class AppCallbackImplBase implements io.grpc.BindableService { + + /** + *
+     * Lists all topics subscribed by this app.
+     * 
+ */ + public void listTopicSubscriptions(com.google.protobuf.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListTopicSubscriptionsMethod(), responseObserver); + } + + /** + *
+     * Subscribes events from Pubsub
+     * 
+ */ + public void onTopicEvent(spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getOnTopicEventMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getListTopicSubscriptionsMethod(), + asyncUnaryCall( + new MethodHandlers< + com.google.protobuf.Empty, + spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse>( + this, METHODID_LIST_TOPIC_SUBSCRIPTIONS))) + .addMethod( + getOnTopicEventMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest, + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse>( + this, METHODID_ON_TOPIC_EVENT))) + .build(); + } + } + + /** + *
+   * AppCallback V1 allows user application to interact with runtime.
+   * User application needs to implement AppCallback service if it needs to
+   * receive message from runtime.
+   * 
+ */ + public static final class AppCallbackStub extends io.grpc.stub.AbstractAsyncStub { + private AppCallbackStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppCallbackStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppCallbackStub(channel, callOptions); + } + + /** + *
+     * Lists all topics subscribed by this app.
+     * 
+ */ + public void listTopicSubscriptions(com.google.protobuf.Empty request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListTopicSubscriptionsMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Subscribes events from Pubsub
+     * 
+ */ + public void onTopicEvent(spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getOnTopicEventMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + *
+   * AppCallback V1 allows user application to interact with runtime.
+   * User application needs to implement AppCallback service if it needs to
+   * receive message from runtime.
+   * 
+ */ + public static final class AppCallbackBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private AppCallbackBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppCallbackBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppCallbackBlockingStub(channel, callOptions); + } + + /** + *
+     * Lists all topics subscribed by this app.
+     * 
+ */ + public spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse listTopicSubscriptions(com.google.protobuf.Empty request) { + return blockingUnaryCall( + getChannel(), getListTopicSubscriptionsMethod(), getCallOptions(), request); + } + + /** + *
+     * Subscribes events from Pubsub
+     * 
+ */ + public spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse onTopicEvent(spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest request) { + return blockingUnaryCall( + getChannel(), getOnTopicEventMethod(), getCallOptions(), request); + } + } + + /** + *
+   * AppCallback V1 allows user application to interact with runtime.
+   * User application needs to implement AppCallback service if it needs to
+   * receive message from runtime.
+   * 
+ */ + public static final class AppCallbackFutureStub extends io.grpc.stub.AbstractFutureStub { + private AppCallbackFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected AppCallbackFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new AppCallbackFutureStub(channel, callOptions); + } + + /** + *
+     * Lists all topics subscribed by this app.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listTopicSubscriptions( + com.google.protobuf.Empty request) { + return futureUnaryCall( + getChannel().newCall(getListTopicSubscriptionsMethod(), getCallOptions()), request); + } + + /** + *
+     * Subscribes events from Pubsub
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture onTopicEvent( + spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest request) { + return futureUnaryCall( + getChannel().newCall(getOnTopicEventMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_LIST_TOPIC_SUBSCRIPTIONS = 0; + private static final int METHODID_ON_TOPIC_EVENT = 1; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final AppCallbackImplBase serviceImpl; + private final int methodId; + + MethodHandlers(AppCallbackImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_LIST_TOPIC_SUBSCRIPTIONS: + serviceImpl.listTopicSubscriptions((com.google.protobuf.Empty) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_ON_TOPIC_EVENT: + serviceImpl.onTopicEvent((spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + default: + throw new AssertionError(); + } + } + } + + private static abstract class AppCallbackBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + AppCallbackBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return spec.proto.runtime.v1.AppCallbackProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("AppCallback"); + } + } + + private static final class AppCallbackFileDescriptorSupplier + extends AppCallbackBaseDescriptorSupplier { + AppCallbackFileDescriptorSupplier() {} + } + + private static final class AppCallbackMethodDescriptorSupplier + extends AppCallbackBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + AppCallbackMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (AppCallbackGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new AppCallbackFileDescriptorSupplier()) + .addMethod(getListTopicSubscriptionsMethod()) + .addMethod(getOnTopicEventMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/spec/src/main/java/spec/proto/runtime/v1/AppCallbackProto.java b/spec/src/main/java/spec/proto/runtime/v1/AppCallbackProto.java new file mode 100644 index 0000000..3477433 --- /dev/null +++ b/spec/src/main/java/spec/proto/runtime/v1/AppCallbackProto.java @@ -0,0 +1,5202 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/runtime/v1/appcallback.proto + +package spec.proto.runtime.v1; + +public final class AppCallbackProto { + private AppCallbackProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface TopicEventRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.TopicEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * id identifies the event. Producers MUST ensure that source + id 
+     * is unique for each distinct event. If a duplicate event is re-sent
+     * (e.g. due to a network error) it MAY have the same id. 
+     * 
+ * + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + *
+     * id identifies the event. Producers MUST ensure that source + id 
+     * is unique for each distinct event. If a duplicate event is re-sent
+     * (e.g. due to a network error) it MAY have the same id. 
+     * 
+ * + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + *
+     * source identifies the context in which an event happened.
+     * Often this will include information such as the type of the
+     * event source, the organization publishing the event or the process
+     * that produced the event. The exact syntax and semantics behind
+     * the data encoded in the URI is defined by the event producer.
+     * 
+ * + * string source = 2; + * @return The source. + */ + java.lang.String getSource(); + /** + *
+     * source identifies the context in which an event happened.
+     * Often this will include information such as the type of the
+     * event source, the organization publishing the event or the process
+     * that produced the event. The exact syntax and semantics behind
+     * the data encoded in the URI is defined by the event producer.
+     * 
+ * + * string source = 2; + * @return The bytes for source. + */ + com.google.protobuf.ByteString + getSourceBytes(); + + /** + *
+     * The type of event related to the originating occurrence. 
+     * 
+ * + * string type = 3; + * @return The type. + */ + java.lang.String getType(); + /** + *
+     * The type of event related to the originating occurrence. 
+     * 
+ * + * string type = 3; + * @return The bytes for type. + */ + com.google.protobuf.ByteString + getTypeBytes(); + + /** + *
+     * The version of the CloudEvents specification. 
+     * 
+ * + * string spec_version = 4; + * @return The specVersion. + */ + java.lang.String getSpecVersion(); + /** + *
+     * The version of the CloudEvents specification. 
+     * 
+ * + * string spec_version = 4; + * @return The bytes for specVersion. + */ + com.google.protobuf.ByteString + getSpecVersionBytes(); + + /** + *
+     * The content type of data value.
+     * 
+ * + * string data_content_type = 5; + * @return The dataContentType. + */ + java.lang.String getDataContentType(); + /** + *
+     * The content type of data value.
+     * 
+ * + * string data_content_type = 5; + * @return The bytes for dataContentType. + */ + com.google.protobuf.ByteString + getDataContentTypeBytes(); + + /** + *
+     * The content of the event.
+     * 
+ * + * bytes data = 7; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
+     * The pubsub topic which publisher sent to.
+     * 
+ * + * string topic = 6; + * @return The topic. + */ + java.lang.String getTopic(); + /** + *
+     * The pubsub topic which publisher sent to.
+     * 
+ * + * string topic = 6; + * @return The bytes for topic. + */ + com.google.protobuf.ByteString + getTopicBytes(); + + /** + *
+     * The name of the pubsub the publisher sent to.
+     * 
+ * + * string pubsub_name = 8; + * @return The pubsubName. + */ + java.lang.String getPubsubName(); + /** + *
+     * The name of the pubsub the publisher sent to.
+     * 
+ * + * string pubsub_name = 8; + * @return The bytes for pubsubName. + */ + com.google.protobuf.ByteString + getPubsubNameBytes(); + + /** + *
+     * add a map to pass some extra properties.
+     * 
+ * + * map<string, string> metadata = 10; + */ + int getMetadataCount(); + /** + *
+     * add a map to pass some extra properties.
+     * 
+ * + * map<string, string> metadata = 10; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * add a map to pass some extra properties.
+     * 
+ * + * map<string, string> metadata = 10; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * add a map to pass some extra properties.
+     * 
+ * + * map<string, string> metadata = 10; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * add a map to pass some extra properties.
+     * 
+ * + * map<string, string> metadata = 10; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * TopicEventRequest message is compatible with CloudEvent spec v1.0
+   * https://github.com/cloudevents/spec/blob/v1.0/spec.md
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.TopicEventRequest} + */ + public static final class TopicEventRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.TopicEventRequest) + TopicEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopicEventRequest.newBuilder() to construct. + private TopicEventRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopicEventRequest() { + id_ = ""; + source_ = ""; + type_ = ""; + specVersion_ = ""; + dataContentType_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + topic_ = ""; + pubsubName_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopicEventRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopicEventRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + source_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + type_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + specVersion_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + + dataContentType_ = s; + break; + } + case 50: { + java.lang.String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + case 58: { + + data_ = input.readBytes(); + break; + } + case 66: { + java.lang.String s = input.readStringRequireUtf8(); + + pubsubName_ = s; + break; + } + case 82: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 10: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest.class, spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + *
+     * id identifies the event. Producers MUST ensure that source + id 
+     * is unique for each distinct event. If a duplicate event is re-sent
+     * (e.g. due to a network error) it MAY have the same id. 
+     * 
+ * + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + *
+     * id identifies the event. Producers MUST ensure that source + id 
+     * is unique for each distinct event. If a duplicate event is re-sent
+     * (e.g. due to a network error) it MAY have the same id. 
+     * 
+ * + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SOURCE_FIELD_NUMBER = 2; + private volatile java.lang.Object source_; + /** + *
+     * source identifies the context in which an event happened.
+     * Often this will include information such as the type of the
+     * event source, the organization publishing the event or the process
+     * that produced the event. The exact syntax and semantics behind
+     * the data encoded in the URI is defined by the event producer.
+     * 
+ * + * string source = 2; + * @return The source. + */ + @java.lang.Override + public java.lang.String getSource() { + java.lang.Object ref = source_; + 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(); + source_ = s; + return s; + } + } + /** + *
+     * source identifies the context in which an event happened.
+     * Often this will include information such as the type of the
+     * event source, the organization publishing the event or the process
+     * that produced the event. The exact syntax and semantics behind
+     * the data encoded in the URI is defined by the event producer.
+     * 
+ * + * string source = 2; + * @return The bytes for source. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object type_; + /** + *
+     * The type of event related to the originating occurrence. 
+     * 
+ * + * string type = 3; + * @return The type. + */ + @java.lang.Override + public java.lang.String getType() { + java.lang.Object ref = type_; + 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(); + type_ = s; + return s; + } + } + /** + *
+     * The type of event related to the originating occurrence. 
+     * 
+ * + * string type = 3; + * @return The bytes for type. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SPEC_VERSION_FIELD_NUMBER = 4; + private volatile java.lang.Object specVersion_; + /** + *
+     * The version of the CloudEvents specification. 
+     * 
+ * + * string spec_version = 4; + * @return The specVersion. + */ + @java.lang.Override + public java.lang.String getSpecVersion() { + java.lang.Object ref = specVersion_; + 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(); + specVersion_ = s; + return s; + } + } + /** + *
+     * The version of the CloudEvents specification. 
+     * 
+ * + * string spec_version = 4; + * @return The bytes for specVersion. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getSpecVersionBytes() { + java.lang.Object ref = specVersion_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + specVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_CONTENT_TYPE_FIELD_NUMBER = 5; + private volatile java.lang.Object dataContentType_; + /** + *
+     * The content type of data value.
+     * 
+ * + * string data_content_type = 5; + * @return The dataContentType. + */ + @java.lang.Override + public java.lang.String getDataContentType() { + java.lang.Object ref = dataContentType_; + 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(); + dataContentType_ = s; + return s; + } + } + /** + *
+     * The content type of data value.
+     * 
+ * + * string data_content_type = 5; + * @return The bytes for dataContentType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDataContentTypeBytes() { + java.lang.Object ref = dataContentType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dataContentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 7; + private com.google.protobuf.ByteString data_; + /** + *
+     * The content of the event.
+     * 
+ * + * bytes data = 7; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int TOPIC_FIELD_NUMBER = 6; + private volatile java.lang.Object topic_; + /** + *
+     * The pubsub topic which publisher sent to.
+     * 
+ * + * string topic = 6; + * @return The topic. + */ + @java.lang.Override + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + 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(); + topic_ = s; + return s; + } + } + /** + *
+     * The pubsub topic which publisher sent to.
+     * 
+ * + * string topic = 6; + * @return The bytes for topic. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int PUBSUB_NAME_FIELD_NUMBER = 8; + private volatile java.lang.Object pubsubName_; + /** + *
+     * The name of the pubsub the publisher sent to.
+     * 
+ * + * string pubsub_name = 8; + * @return The pubsubName. + */ + @java.lang.Override + public java.lang.String getPubsubName() { + java.lang.Object ref = pubsubName_; + 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(); + pubsubName_ = s; + return s; + } + } + /** + *
+     * The name of the pubsub the publisher sent to.
+     * 
+ * + * string pubsub_name = 8; + * @return The bytes for pubsubName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPubsubNameBytes() { + java.lang.Object ref = pubsubName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pubsubName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 10; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * add a map to pass some extra properties.
+     * 
+ * + * map<string, string> metadata = 10; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * add a map to pass some extra properties.
+     * 
+ * + * map<string, string> metadata = 10; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * add a map to pass some extra properties.
+     * 
+ * + * map<string, string> metadata = 10; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * add a map to pass some extra properties.
+     * 
+ * + * map<string, string> metadata = 10; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (!getSourceBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, source_); + } + if (!getTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, type_); + } + if (!getSpecVersionBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, specVersion_); + } + if (!getDataContentTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, dataContentType_); + } + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 6, topic_); + } + if (!data_.isEmpty()) { + output.writeBytes(7, data_); + } + if (!getPubsubNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 8, pubsubName_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 10); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (!getSourceBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, source_); + } + if (!getTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, type_); + } + if (!getSpecVersionBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, specVersion_); + } + if (!getDataContentTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(5, dataContentType_); + } + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(6, topic_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(7, data_); + } + if (!getPubsubNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(8, pubsubName_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(10, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest other = (spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest) obj; + + if (!getId() + .equals(other.getId())) return false; + if (!getSource() + .equals(other.getSource())) return false; + if (!getType() + .equals(other.getType())) return false; + if (!getSpecVersion() + .equals(other.getSpecVersion())) return false; + if (!getDataContentType() + .equals(other.getDataContentType())) return false; + if (!getData() + .equals(other.getData())) return false; + if (!getTopic() + .equals(other.getTopic())) return false; + if (!getPubsubName() + .equals(other.getPubsubName())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + hash = (37 * hash) + SOURCE_FIELD_NUMBER; + hash = (53 * hash) + getSource().hashCode(); + hash = (37 * hash) + TYPE_FIELD_NUMBER; + hash = (53 * hash) + getType().hashCode(); + hash = (37 * hash) + SPEC_VERSION_FIELD_NUMBER; + hash = (53 * hash) + getSpecVersion().hashCode(); + hash = (37 * hash) + DATA_CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDataContentType().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (37 * hash) + TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getTopic().hashCode(); + hash = (37 * hash) + PUBSUB_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPubsubName().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest 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 spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest 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 spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest 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(spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest 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; + } + /** + *
+     * TopicEventRequest message is compatible with CloudEvent spec v1.0
+     * https://github.com/cloudevents/spec/blob/v1.0/spec.md
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.TopicEventRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.TopicEventRequest) + spec.proto.runtime.v1.AppCallbackProto.TopicEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 10: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 10: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest.class, spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + source_ = ""; + + type_ = ""; + + specVersion_ = ""; + + dataContentType_ = ""; + + data_ = com.google.protobuf.ByteString.EMPTY; + + topic_ = ""; + + pubsubName_ = ""; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest build() { + spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest buildPartial() { + spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest result = new spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest(this); + int from_bitField0_ = bitField0_; + result.id_ = id_; + result.source_ = source_; + result.type_ = type_; + result.specVersion_ = specVersion_; + result.dataContentType_ = dataContentType_; + result.data_ = data_; + result.topic_ = topic_; + result.pubsubName_ = pubsubName_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest) { + return mergeFrom((spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest other) { + if (other == spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (!other.getSource().isEmpty()) { + source_ = other.source_; + onChanged(); + } + if (!other.getType().isEmpty()) { + type_ = other.type_; + onChanged(); + } + if (!other.getSpecVersion().isEmpty()) { + specVersion_ = other.specVersion_; + onChanged(); + } + if (!other.getDataContentType().isEmpty()) { + dataContentType_ = other.dataContentType_; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + if (!other.getPubsubName().isEmpty()) { + pubsubName_ = other.pubsubName_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object id_ = ""; + /** + *
+       * id identifies the event. Producers MUST ensure that source + id 
+       * is unique for each distinct event. If a duplicate event is re-sent
+       * (e.g. due to a network error) it MAY have the same id. 
+       * 
+ * + * string id = 1; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * id identifies the event. Producers MUST ensure that source + id 
+       * is unique for each distinct event. If a duplicate event is re-sent
+       * (e.g. due to a network error) it MAY have the same id. 
+       * 
+ * + * string id = 1; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * id identifies the event. Producers MUST ensure that source + id 
+       * is unique for each distinct event. If a duplicate event is re-sent
+       * (e.g. due to a network error) it MAY have the same id. 
+       * 
+ * + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + *
+       * id identifies the event. Producers MUST ensure that source + id 
+       * is unique for each distinct event. If a duplicate event is re-sent
+       * (e.g. due to a network error) it MAY have the same id. 
+       * 
+ * + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + *
+       * id identifies the event. Producers MUST ensure that source + id 
+       * is unique for each distinct event. If a duplicate event is re-sent
+       * (e.g. due to a network error) it MAY have the same id. 
+       * 
+ * + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private java.lang.Object source_ = ""; + /** + *
+       * source identifies the context in which an event happened.
+       * Often this will include information such as the type of the
+       * event source, the organization publishing the event or the process
+       * that produced the event. The exact syntax and semantics behind
+       * the data encoded in the URI is defined by the event producer.
+       * 
+ * + * string source = 2; + * @return The source. + */ + public java.lang.String getSource() { + java.lang.Object ref = source_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + source_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * source identifies the context in which an event happened.
+       * Often this will include information such as the type of the
+       * event source, the organization publishing the event or the process
+       * that produced the event. The exact syntax and semantics behind
+       * the data encoded in the URI is defined by the event producer.
+       * 
+ * + * string source = 2; + * @return The bytes for source. + */ + public com.google.protobuf.ByteString + getSourceBytes() { + java.lang.Object ref = source_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + source_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * source identifies the context in which an event happened.
+       * Often this will include information such as the type of the
+       * event source, the organization publishing the event or the process
+       * that produced the event. The exact syntax and semantics behind
+       * the data encoded in the URI is defined by the event producer.
+       * 
+ * + * string source = 2; + * @param value The source to set. + * @return This builder for chaining. + */ + public Builder setSource( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + source_ = value; + onChanged(); + return this; + } + /** + *
+       * source identifies the context in which an event happened.
+       * Often this will include information such as the type of the
+       * event source, the organization publishing the event or the process
+       * that produced the event. The exact syntax and semantics behind
+       * the data encoded in the URI is defined by the event producer.
+       * 
+ * + * string source = 2; + * @return This builder for chaining. + */ + public Builder clearSource() { + + source_ = getDefaultInstance().getSource(); + onChanged(); + return this; + } + /** + *
+       * source identifies the context in which an event happened.
+       * Often this will include information such as the type of the
+       * event source, the organization publishing the event or the process
+       * that produced the event. The exact syntax and semantics behind
+       * the data encoded in the URI is defined by the event producer.
+       * 
+ * + * string source = 2; + * @param value The bytes for source to set. + * @return This builder for chaining. + */ + public Builder setSourceBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + source_ = value; + onChanged(); + return this; + } + + private java.lang.Object type_ = ""; + /** + *
+       * The type of event related to the originating occurrence. 
+       * 
+ * + * string type = 3; + * @return The type. + */ + public java.lang.String getType() { + java.lang.Object ref = type_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + type_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The type of event related to the originating occurrence. 
+       * 
+ * + * string type = 3; + * @return The bytes for type. + */ + public com.google.protobuf.ByteString + getTypeBytes() { + java.lang.Object ref = type_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + type_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The type of event related to the originating occurrence. 
+       * 
+ * + * string type = 3; + * @param value The type to set. + * @return This builder for chaining. + */ + public Builder setType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + type_ = value; + onChanged(); + return this; + } + /** + *
+       * The type of event related to the originating occurrence. 
+       * 
+ * + * string type = 3; + * @return This builder for chaining. + */ + public Builder clearType() { + + type_ = getDefaultInstance().getType(); + onChanged(); + return this; + } + /** + *
+       * The type of event related to the originating occurrence. 
+       * 
+ * + * string type = 3; + * @param value The bytes for type to set. + * @return This builder for chaining. + */ + public Builder setTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + type_ = value; + onChanged(); + return this; + } + + private java.lang.Object specVersion_ = ""; + /** + *
+       * The version of the CloudEvents specification. 
+       * 
+ * + * string spec_version = 4; + * @return The specVersion. + */ + public java.lang.String getSpecVersion() { + java.lang.Object ref = specVersion_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + specVersion_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The version of the CloudEvents specification. 
+       * 
+ * + * string spec_version = 4; + * @return The bytes for specVersion. + */ + public com.google.protobuf.ByteString + getSpecVersionBytes() { + java.lang.Object ref = specVersion_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + specVersion_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The version of the CloudEvents specification. 
+       * 
+ * + * string spec_version = 4; + * @param value The specVersion to set. + * @return This builder for chaining. + */ + public Builder setSpecVersion( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + specVersion_ = value; + onChanged(); + return this; + } + /** + *
+       * The version of the CloudEvents specification. 
+       * 
+ * + * string spec_version = 4; + * @return This builder for chaining. + */ + public Builder clearSpecVersion() { + + specVersion_ = getDefaultInstance().getSpecVersion(); + onChanged(); + return this; + } + /** + *
+       * The version of the CloudEvents specification. 
+       * 
+ * + * string spec_version = 4; + * @param value The bytes for specVersion to set. + * @return This builder for chaining. + */ + public Builder setSpecVersionBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + specVersion_ = value; + onChanged(); + return this; + } + + private java.lang.Object dataContentType_ = ""; + /** + *
+       * The content type of data value.
+       * 
+ * + * string data_content_type = 5; + * @return The dataContentType. + */ + public java.lang.String getDataContentType() { + java.lang.Object ref = dataContentType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataContentType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The content type of data value.
+       * 
+ * + * string data_content_type = 5; + * @return The bytes for dataContentType. + */ + public com.google.protobuf.ByteString + getDataContentTypeBytes() { + java.lang.Object ref = dataContentType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dataContentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The content type of data value.
+       * 
+ * + * string data_content_type = 5; + * @param value The dataContentType to set. + * @return This builder for chaining. + */ + public Builder setDataContentType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataContentType_ = value; + onChanged(); + return this; + } + /** + *
+       * The content type of data value.
+       * 
+ * + * string data_content_type = 5; + * @return This builder for chaining. + */ + public Builder clearDataContentType() { + + dataContentType_ = getDefaultInstance().getDataContentType(); + onChanged(); + return this; + } + /** + *
+       * The content type of data value.
+       * 
+ * + * string data_content_type = 5; + * @param value The bytes for dataContentType to set. + * @return This builder for chaining. + */ + public Builder setDataContentTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataContentType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The content of the event.
+       * 
+ * + * bytes data = 7; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+       * The content of the event.
+       * 
+ * + * bytes data = 7; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
+       * The content of the event.
+       * 
+ * + * bytes data = 7; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private java.lang.Object topic_ = ""; + /** + *
+       * The pubsub topic which publisher sent to.
+       * 
+ * + * string topic = 6; + * @return The topic. + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The pubsub topic which publisher sent to.
+       * 
+ * + * string topic = 6; + * @return The bytes for topic. + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The pubsub topic which publisher sent to.
+       * 
+ * + * string topic = 6; + * @param value The topic to set. + * @return This builder for chaining. + */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + *
+       * The pubsub topic which publisher sent to.
+       * 
+ * + * string topic = 6; + * @return This builder for chaining. + */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + *
+       * The pubsub topic which publisher sent to.
+       * 
+ * + * string topic = 6; + * @param value The bytes for topic to set. + * @return This builder for chaining. + */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + + private java.lang.Object pubsubName_ = ""; + /** + *
+       * The name of the pubsub the publisher sent to.
+       * 
+ * + * string pubsub_name = 8; + * @return The pubsubName. + */ + public java.lang.String getPubsubName() { + java.lang.Object ref = pubsubName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of the pubsub the publisher sent to.
+       * 
+ * + * string pubsub_name = 8; + * @return The bytes for pubsubName. + */ + public com.google.protobuf.ByteString + getPubsubNameBytes() { + java.lang.Object ref = pubsubName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pubsubName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of the pubsub the publisher sent to.
+       * 
+ * + * string pubsub_name = 8; + * @param value The pubsubName to set. + * @return This builder for chaining. + */ + public Builder setPubsubName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pubsubName_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of the pubsub the publisher sent to.
+       * 
+ * + * string pubsub_name = 8; + * @return This builder for chaining. + */ + public Builder clearPubsubName() { + + pubsubName_ = getDefaultInstance().getPubsubName(); + onChanged(); + return this; + } + /** + *
+       * The name of the pubsub the publisher sent to.
+       * 
+ * + * string pubsub_name = 8; + * @param value The bytes for pubsubName to set. + * @return This builder for chaining. + */ + public Builder setPubsubNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pubsubName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * add a map to pass some extra properties.
+       * 
+ * + * map<string, string> metadata = 10; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * add a map to pass some extra properties.
+       * 
+ * + * map<string, string> metadata = 10; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * add a map to pass some extra properties.
+       * 
+ * + * map<string, string> metadata = 10; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * add a map to pass some extra properties.
+       * 
+ * + * map<string, string> metadata = 10; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * add a map to pass some extra properties.
+       * 
+ * + * map<string, string> metadata = 10; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * add a map to pass some extra properties.
+       * 
+ * + * map<string, string> metadata = 10; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * add a map to pass some extra properties.
+       * 
+ * + * map<string, string> metadata = 10; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.TopicEventRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.TopicEventRequest) + private static final spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest(); + } + + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopicEventRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopicEventRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicEventRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopicEventResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.TopicEventResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The list of output bindings.
+     * 
+ * + * .spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus status = 1; + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + /** + *
+     * The list of output bindings.
+     * 
+ * + * .spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus status = 1; + * @return The status. + */ + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus getStatus(); + } + /** + *
+   * TopicEventResponse is response from app on published message
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.TopicEventResponse} + */ + public static final class TopicEventResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.TopicEventResponse) + TopicEventResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopicEventResponse.newBuilder() to construct. + private TopicEventResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopicEventResponse() { + status_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopicEventResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopicEventResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + status_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.class, spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.Builder.class); + } + + /** + *
+     * TopicEventResponseStatus allows apps to have finer control over handling of the message.
+     * 
+ * + * Protobuf enum {@code spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus} + */ + public enum TopicEventResponseStatus + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * SUCCESS is the default behavior: message is acknowledged and not retried or logged.
+       * 
+ * + * SUCCESS = 0; + */ + SUCCESS(0), + /** + *
+       * RETRY status signals runtime to retry the message as part of an expected scenario (no warning is logged).
+       * 
+ * + * RETRY = 1; + */ + RETRY(1), + /** + *
+       * DROP status signals runtime to drop the message as part of an unexpected scenario (warning is logged).
+       * 
+ * + * DROP = 2; + */ + DROP(2), + UNRECOGNIZED(-1), + ; + + /** + *
+       * SUCCESS is the default behavior: message is acknowledged and not retried or logged.
+       * 
+ * + * SUCCESS = 0; + */ + public static final int SUCCESS_VALUE = 0; + /** + *
+       * RETRY status signals runtime to retry the message as part of an expected scenario (no warning is logged).
+       * 
+ * + * RETRY = 1; + */ + public static final int RETRY_VALUE = 1; + /** + *
+       * DROP status signals runtime to drop the message as part of an unexpected scenario (warning is logged).
+       * 
+ * + * DROP = 2; + */ + public static final int DROP_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 TopicEventResponseStatus 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 TopicEventResponseStatus forNumber(int value) { + switch (value) { + case 0: return SUCCESS; + case 1: return RETRY; + case 2: return DROP; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + TopicEventResponseStatus> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public TopicEventResponseStatus findValueByNumber(int number) { + return TopicEventResponseStatus.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 spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final TopicEventResponseStatus[] VALUES = values(); + + public static TopicEventResponseStatus 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 TopicEventResponseStatus(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus) + } + + public static final int STATUS_FIELD_NUMBER = 1; + private int status_; + /** + *
+     * The list of output bindings.
+     * 
+ * + * .spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus status = 1; + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override public int getStatusValue() { + return status_; + } + /** + *
+     * The list of output bindings.
+     * 
+ * + * .spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus status = 1; + * @return The status. + */ + @java.lang.Override public spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus getStatus() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus result = spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus.valueOf(status_); + return result == null ? spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus.UNRECOGNIZED : result; + } + + 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 (status_ != spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus.SUCCESS.getNumber()) { + output.writeEnum(1, status_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (status_ != spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus.SUCCESS.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse other = (spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse) obj; + + if (status_ != other.status_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse 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 spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse 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 spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse 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(spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse 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; + } + /** + *
+     * TopicEventResponse is response from app on published message
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.TopicEventResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.TopicEventResponse) + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.class, spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + status_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicEventResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse build() { + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse buildPartial() { + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse result = new spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse(this); + result.status_ = status_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse) { + return mergeFrom((spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse other) { + if (other == spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.getDefaultInstance()) return this; + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int status_ = 0; + /** + *
+       * The list of output bindings.
+       * 
+ * + * .spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus status = 1; + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override public int getStatusValue() { + return status_; + } + /** + *
+       * The list of output bindings.
+       * 
+ * + * .spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus status = 1; + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + + status_ = value; + onChanged(); + return this; + } + /** + *
+       * The list of output bindings.
+       * 
+ * + * .spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus status = 1; + * @return The status. + */ + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus getStatus() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus result = spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus.valueOf(status_); + return result == null ? spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus.UNRECOGNIZED : result; + } + /** + *
+       * The list of output bindings.
+       * 
+ * + * .spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus status = 1; + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse.TopicEventResponseStatus value) { + if (value == null) { + throw new NullPointerException(); + } + + status_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * The list of output bindings.
+       * 
+ * + * .spec.proto.runtime.v1.TopicEventResponse.TopicEventResponseStatus status = 1; + * @return This builder for chaining. + */ + public Builder clearStatus() { + + status_ = 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:spec.proto.runtime.v1.TopicEventResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.TopicEventResponse) + private static final spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse(); + } + + public static spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopicEventResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopicEventResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicEventResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ListTopicSubscriptionsResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.ListTopicSubscriptionsResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The list of topics.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + java.util.List + getSubscriptionsList(); + /** + *
+     * The list of topics.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription getSubscriptions(int index); + /** + *
+     * The list of topics.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + int getSubscriptionsCount(); + /** + *
+     * The list of topics.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + java.util.List + getSubscriptionsOrBuilderList(); + /** + *
+     * The list of topics.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + spec.proto.runtime.v1.AppCallbackProto.TopicSubscriptionOrBuilder getSubscriptionsOrBuilder( + int index); + } + /** + *
+   * ListTopicSubscriptionsResponse is the message including the list of the subscribing topics.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.ListTopicSubscriptionsResponse} + */ + public static final class ListTopicSubscriptionsResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.ListTopicSubscriptionsResponse) + ListTopicSubscriptionsResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListTopicSubscriptionsResponse.newBuilder() to construct. + private ListTopicSubscriptionsResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListTopicSubscriptionsResponse() { + subscriptions_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListTopicSubscriptionsResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListTopicSubscriptionsResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + subscriptions_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + subscriptions_.add( + input.readMessage(spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + subscriptions_ = java.util.Collections.unmodifiableList(subscriptions_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_ListTopicSubscriptionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_ListTopicSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse.class, spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse.Builder.class); + } + + public static final int SUBSCRIPTIONS_FIELD_NUMBER = 1; + private java.util.List subscriptions_; + /** + *
+     * The list of topics.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + @java.lang.Override + public java.util.List getSubscriptionsList() { + return subscriptions_; + } + /** + *
+     * The list of topics.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + @java.lang.Override + public java.util.List + getSubscriptionsOrBuilderList() { + return subscriptions_; + } + /** + *
+     * The list of topics.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + @java.lang.Override + public int getSubscriptionsCount() { + return subscriptions_.size(); + } + /** + *
+     * The list of topics.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscription getSubscriptions(int index) { + return subscriptions_.get(index); + } + /** + *
+     * The list of topics.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscriptionOrBuilder getSubscriptionsOrBuilder( + int index) { + return subscriptions_.get(index); + } + + 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 < subscriptions_.size(); i++) { + output.writeMessage(1, subscriptions_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < subscriptions_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, subscriptions_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse other = (spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse) obj; + + if (!getSubscriptionsList() + .equals(other.getSubscriptionsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getSubscriptionsCount() > 0) { + hash = (37 * hash) + SUBSCRIPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getSubscriptionsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse 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 spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse 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 spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse 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(spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse 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; + } + /** + *
+     * ListTopicSubscriptionsResponse is the message including the list of the subscribing topics.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.ListTopicSubscriptionsResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.ListTopicSubscriptionsResponse) + spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_ListTopicSubscriptionsResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_ListTopicSubscriptionsResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse.class, spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getSubscriptionsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (subscriptionsBuilder_ == null) { + subscriptions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + subscriptionsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_ListTopicSubscriptionsResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse build() { + spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse buildPartial() { + spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse result = new spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse(this); + int from_bitField0_ = bitField0_; + if (subscriptionsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + subscriptions_ = java.util.Collections.unmodifiableList(subscriptions_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.subscriptions_ = subscriptions_; + } else { + result.subscriptions_ = subscriptionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse) { + return mergeFrom((spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse other) { + if (other == spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse.getDefaultInstance()) return this; + if (subscriptionsBuilder_ == null) { + if (!other.subscriptions_.isEmpty()) { + if (subscriptions_.isEmpty()) { + subscriptions_ = other.subscriptions_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureSubscriptionsIsMutable(); + subscriptions_.addAll(other.subscriptions_); + } + onChanged(); + } + } else { + if (!other.subscriptions_.isEmpty()) { + if (subscriptionsBuilder_.isEmpty()) { + subscriptionsBuilder_.dispose(); + subscriptionsBuilder_ = null; + subscriptions_ = other.subscriptions_; + bitField0_ = (bitField0_ & ~0x00000001); + subscriptionsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getSubscriptionsFieldBuilder() : null; + } else { + subscriptionsBuilder_.addAllMessages(other.subscriptions_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List subscriptions_ = + java.util.Collections.emptyList(); + private void ensureSubscriptionsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + subscriptions_ = new java.util.ArrayList(subscriptions_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription, spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder, spec.proto.runtime.v1.AppCallbackProto.TopicSubscriptionOrBuilder> subscriptionsBuilder_; + + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public java.util.List getSubscriptionsList() { + if (subscriptionsBuilder_ == null) { + return java.util.Collections.unmodifiableList(subscriptions_); + } else { + return subscriptionsBuilder_.getMessageList(); + } + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public int getSubscriptionsCount() { + if (subscriptionsBuilder_ == null) { + return subscriptions_.size(); + } else { + return subscriptionsBuilder_.getCount(); + } + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscription getSubscriptions(int index) { + if (subscriptionsBuilder_ == null) { + return subscriptions_.get(index); + } else { + return subscriptionsBuilder_.getMessage(index); + } + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public Builder setSubscriptions( + int index, spec.proto.runtime.v1.AppCallbackProto.TopicSubscription value) { + if (subscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.set(index, value); + onChanged(); + } else { + subscriptionsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public Builder setSubscriptions( + int index, spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder builderForValue) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.set(index, builderForValue.build()); + onChanged(); + } else { + subscriptionsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public Builder addSubscriptions(spec.proto.runtime.v1.AppCallbackProto.TopicSubscription value) { + if (subscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.add(value); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public Builder addSubscriptions( + int index, spec.proto.runtime.v1.AppCallbackProto.TopicSubscription value) { + if (subscriptionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureSubscriptionsIsMutable(); + subscriptions_.add(index, value); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public Builder addSubscriptions( + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder builderForValue) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.add(builderForValue.build()); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public Builder addSubscriptions( + int index, spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder builderForValue) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.add(index, builderForValue.build()); + onChanged(); + } else { + subscriptionsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public Builder addAllSubscriptions( + java.lang.Iterable values) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, subscriptions_); + onChanged(); + } else { + subscriptionsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public Builder clearSubscriptions() { + if (subscriptionsBuilder_ == null) { + subscriptions_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + subscriptionsBuilder_.clear(); + } + return this; + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public Builder removeSubscriptions(int index) { + if (subscriptionsBuilder_ == null) { + ensureSubscriptionsIsMutable(); + subscriptions_.remove(index); + onChanged(); + } else { + subscriptionsBuilder_.remove(index); + } + return this; + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder getSubscriptionsBuilder( + int index) { + return getSubscriptionsFieldBuilder().getBuilder(index); + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscriptionOrBuilder getSubscriptionsOrBuilder( + int index) { + if (subscriptionsBuilder_ == null) { + return subscriptions_.get(index); } else { + return subscriptionsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public java.util.List + getSubscriptionsOrBuilderList() { + if (subscriptionsBuilder_ != null) { + return subscriptionsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(subscriptions_); + } + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder addSubscriptionsBuilder() { + return getSubscriptionsFieldBuilder().addBuilder( + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.getDefaultInstance()); + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder addSubscriptionsBuilder( + int index) { + return getSubscriptionsFieldBuilder().addBuilder( + index, spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.getDefaultInstance()); + } + /** + *
+       * The list of topics.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TopicSubscription subscriptions = 1; + */ + public java.util.List + getSubscriptionsBuilderList() { + return getSubscriptionsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription, spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder, spec.proto.runtime.v1.AppCallbackProto.TopicSubscriptionOrBuilder> + getSubscriptionsFieldBuilder() { + if (subscriptionsBuilder_ == null) { + subscriptionsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription, spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder, spec.proto.runtime.v1.AppCallbackProto.TopicSubscriptionOrBuilder>( + subscriptions_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + subscriptions_ = null; + } + return subscriptionsBuilder_; + } + @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:spec.proto.runtime.v1.ListTopicSubscriptionsResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.ListTopicSubscriptionsResponse) + private static final spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse(); + } + + public static spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListTopicSubscriptionsResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListTopicSubscriptionsResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.ListTopicSubscriptionsResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TopicSubscriptionOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.TopicSubscription) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. The name of the pubsub containing the topic below to subscribe to.
+     * 
+ * + * string pubsub_name = 1; + * @return The pubsubName. + */ + java.lang.String getPubsubName(); + /** + *
+     * Required. The name of the pubsub containing the topic below to subscribe to.
+     * 
+ * + * string pubsub_name = 1; + * @return The bytes for pubsubName. + */ + com.google.protobuf.ByteString + getPubsubNameBytes(); + + /** + *
+     * Required. The name of topic which will be subscribed
+     * 
+ * + * string topic = 2; + * @return The topic. + */ + java.lang.String getTopic(); + /** + *
+     * Required. The name of topic which will be subscribed
+     * 
+ * + * string topic = 2; + * @return The bytes for topic. + */ + com.google.protobuf.ByteString + getTopicBytes(); + + /** + *
+     * The optional properties used for this topic's subscription e.g. session id
+     * 
+ * + * map<string, string> metadata = 3; + */ + int getMetadataCount(); + /** + *
+     * The optional properties used for this topic's subscription e.g. session id
+     * 
+ * + * map<string, string> metadata = 3; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The optional properties used for this topic's subscription e.g. session id
+     * 
+ * + * map<string, string> metadata = 3; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The optional properties used for this topic's subscription e.g. session id
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The optional properties used for this topic's subscription e.g. session id
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * TopicSubscription represents topic and metadata.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.TopicSubscription} + */ + public static final class TopicSubscription extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.TopicSubscription) + TopicSubscriptionOrBuilder { + private static final long serialVersionUID = 0L; + // Use TopicSubscription.newBuilder() to construct. + private TopicSubscription(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TopicSubscription() { + pubsubName_ = ""; + topic_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TopicSubscription(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TopicSubscription( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + pubsubName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicSubscription_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicSubscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.class, spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder.class); + } + + public static final int PUBSUB_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object pubsubName_; + /** + *
+     * Required. The name of the pubsub containing the topic below to subscribe to.
+     * 
+ * + * string pubsub_name = 1; + * @return The pubsubName. + */ + @java.lang.Override + public java.lang.String getPubsubName() { + java.lang.Object ref = pubsubName_; + 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(); + pubsubName_ = s; + return s; + } + } + /** + *
+     * Required. The name of the pubsub containing the topic below to subscribe to.
+     * 
+ * + * string pubsub_name = 1; + * @return The bytes for pubsubName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPubsubNameBytes() { + java.lang.Object ref = pubsubName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pubsubName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOPIC_FIELD_NUMBER = 2; + private volatile java.lang.Object topic_; + /** + *
+     * Required. The name of topic which will be subscribed
+     * 
+ * + * string topic = 2; + * @return The topic. + */ + @java.lang.Override + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + 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(); + topic_ = s; + return s; + } + } + /** + *
+     * Required. The name of topic which will be subscribed
+     * 
+ * + * string topic = 2; + * @return The bytes for topic. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 3; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicSubscription_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The optional properties used for this topic's subscription e.g. session id
+     * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The optional properties used for this topic's subscription e.g. session id
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The optional properties used for this topic's subscription e.g. session id
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The optional properties used for this topic's subscription e.g. session id
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getPubsubNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pubsubName_); + } + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, topic_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 3); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPubsubNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pubsubName_); + } + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, topic_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.AppCallbackProto.TopicSubscription)) { + return super.equals(obj); + } + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription other = (spec.proto.runtime.v1.AppCallbackProto.TopicSubscription) obj; + + if (!getPubsubName() + .equals(other.getPubsubName())) return false; + if (!getTopic() + .equals(other.getTopic())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PUBSUB_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPubsubName().hashCode(); + hash = (37 * hash) + TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getTopic().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription 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 spec.proto.runtime.v1.AppCallbackProto.TopicSubscription parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription 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 spec.proto.runtime.v1.AppCallbackProto.TopicSubscription parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription 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(spec.proto.runtime.v1.AppCallbackProto.TopicSubscription 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; + } + /** + *
+     * TopicSubscription represents topic and metadata.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.TopicSubscription} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.TopicSubscription) + spec.proto.runtime.v1.AppCallbackProto.TopicSubscriptionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicSubscription_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicSubscription_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.class, spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.Builder.class); + } + + // Construct using spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + pubsubName_ = ""; + + topic_ = ""; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.AppCallbackProto.internal_static_spec_proto_runtime_v1_TopicSubscription_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscription getDefaultInstanceForType() { + return spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscription build() { + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscription buildPartial() { + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription result = new spec.proto.runtime.v1.AppCallbackProto.TopicSubscription(this); + int from_bitField0_ = bitField0_; + result.pubsubName_ = pubsubName_; + result.topic_ = topic_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.AppCallbackProto.TopicSubscription) { + return mergeFrom((spec.proto.runtime.v1.AppCallbackProto.TopicSubscription)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.AppCallbackProto.TopicSubscription other) { + if (other == spec.proto.runtime.v1.AppCallbackProto.TopicSubscription.getDefaultInstance()) return this; + if (!other.getPubsubName().isEmpty()) { + pubsubName_ = other.pubsubName_; + onChanged(); + } + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.AppCallbackProto.TopicSubscription parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.AppCallbackProto.TopicSubscription) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object pubsubName_ = ""; + /** + *
+       * Required. The name of the pubsub containing the topic below to subscribe to.
+       * 
+ * + * string pubsub_name = 1; + * @return The pubsubName. + */ + public java.lang.String getPubsubName() { + java.lang.Object ref = pubsubName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The name of the pubsub containing the topic below to subscribe to.
+       * 
+ * + * string pubsub_name = 1; + * @return The bytes for pubsubName. + */ + public com.google.protobuf.ByteString + getPubsubNameBytes() { + java.lang.Object ref = pubsubName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pubsubName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The name of the pubsub containing the topic below to subscribe to.
+       * 
+ * + * string pubsub_name = 1; + * @param value The pubsubName to set. + * @return This builder for chaining. + */ + public Builder setPubsubName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pubsubName_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The name of the pubsub containing the topic below to subscribe to.
+       * 
+ * + * string pubsub_name = 1; + * @return This builder for chaining. + */ + public Builder clearPubsubName() { + + pubsubName_ = getDefaultInstance().getPubsubName(); + onChanged(); + return this; + } + /** + *
+       * Required. The name of the pubsub containing the topic below to subscribe to.
+       * 
+ * + * string pubsub_name = 1; + * @param value The bytes for pubsubName to set. + * @return This builder for chaining. + */ + public Builder setPubsubNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pubsubName_ = value; + onChanged(); + return this; + } + + private java.lang.Object topic_ = ""; + /** + *
+       * Required. The name of topic which will be subscribed
+       * 
+ * + * string topic = 2; + * @return The topic. + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The name of topic which will be subscribed
+       * 
+ * + * string topic = 2; + * @return The bytes for topic. + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The name of topic which will be subscribed
+       * 
+ * + * string topic = 2; + * @param value The topic to set. + * @return This builder for chaining. + */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The name of topic which will be subscribed
+       * 
+ * + * string topic = 2; + * @return This builder for chaining. + */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + *
+       * Required. The name of topic which will be subscribed
+       * 
+ * + * string topic = 2; + * @param value The bytes for topic to set. + * @return This builder for chaining. + */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The optional properties used for this topic's subscription e.g. session id
+       * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The optional properties used for this topic's subscription e.g. session id
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The optional properties used for this topic's subscription e.g. session id
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The optional properties used for this topic's subscription e.g. session id
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The optional properties used for this topic's subscription e.g. session id
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The optional properties used for this topic's subscription e.g. session id
+       * 
+ * + * map<string, string> metadata = 3; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The optional properties used for this topic's subscription e.g. session id
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.TopicSubscription) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.TopicSubscription) + private static final spec.proto.runtime.v1.AppCallbackProto.TopicSubscription DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.AppCallbackProto.TopicSubscription(); + } + + public static spec.proto.runtime.v1.AppCallbackProto.TopicSubscription getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TopicSubscription parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TopicSubscription(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.AppCallbackProto.TopicSubscription getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_TopicEventRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_TopicEventRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_TopicEventRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_TopicEventRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_TopicEventResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_TopicEventResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_ListTopicSubscriptionsResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_ListTopicSubscriptionsResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_TopicSubscription_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_TopicSubscription_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_TopicSubscription_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_TopicSubscription_MetadataEntry_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\"proto/runtime/v1/appcallback.proto\022\025sp" + + "ec.proto.runtime.v1\032\033google/protobuf/emp" + + "ty.proto\"\233\002\n\021TopicEventRequest\022\n\n\002id\030\001 \001" + + "(\t\022\016\n\006source\030\002 \001(\t\022\014\n\004type\030\003 \001(\t\022\024\n\014spec" + + "_version\030\004 \001(\t\022\031\n\021data_content_type\030\005 \001(" + + "\t\022\014\n\004data\030\007 \001(\014\022\r\n\005topic\030\006 \001(\t\022\023\n\013pubsub" + + "_name\030\010 \001(\t\022H\n\010metadata\030\n \003(\01326.spec.pro" + + "to.runtime.v1.TopicEventRequest.Metadata" + + "Entry\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t:\0028\001\"\246\001\n\022TopicEventResponse\022R\n" + + "\006status\030\001 \001(\0162B.spec.proto.runtime.v1.To" + + "picEventResponse.TopicEventResponseStatu" + + "s\"<\n\030TopicEventResponseStatus\022\013\n\007SUCCESS" + + "\020\000\022\t\n\005RETRY\020\001\022\010\n\004DROP\020\002\"a\n\036ListTopicSubs" + + "criptionsResponse\022?\n\rsubscriptions\030\001 \003(\013" + + "2(.spec.proto.runtime.v1.TopicSubscripti" + + "on\"\262\001\n\021TopicSubscription\022\023\n\013pubsub_name\030" + + "\001 \001(\t\022\r\n\005topic\030\002 \001(\t\022H\n\010metadata\030\003 \003(\01326" + + ".spec.proto.runtime.v1.TopicSubscription" + + ".MetadataEntry\032/\n\rMetadataEntry\022\013\n\003key\030\001" + + " \001(\t\022\r\n\005value\030\002 \001(\t:\0028\0012\337\001\n\013AppCallback\022" + + "i\n\026ListTopicSubscriptions\022\026.google.proto" + + "buf.Empty\0325.spec.proto.runtime.v1.ListTo" + + "picSubscriptionsResponse\"\000\022e\n\014OnTopicEve" + + "nt\022(.spec.proto.runtime.v1.TopicEventReq" + + "uest\032).spec.proto.runtime.v1.TopicEventR" + + "esponse\"\000BX\n\025spec.proto.runtime.v1B\020AppC" + + "allbackProtoZ-mosn.io/layotto/spec/proto" + + "/runtime/v1;runtimeb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.EmptyProto.getDescriptor(), + }); + internal_static_spec_proto_runtime_v1_TopicEventRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_spec_proto_runtime_v1_TopicEventRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_TopicEventRequest_descriptor, + new java.lang.String[] { "Id", "Source", "Type", "SpecVersion", "DataContentType", "Data", "Topic", "PubsubName", "Metadata", }); + internal_static_spec_proto_runtime_v1_TopicEventRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_TopicEventRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_TopicEventRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_TopicEventRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_TopicEventResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_spec_proto_runtime_v1_TopicEventResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_TopicEventResponse_descriptor, + new java.lang.String[] { "Status", }); + internal_static_spec_proto_runtime_v1_ListTopicSubscriptionsResponse_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_spec_proto_runtime_v1_ListTopicSubscriptionsResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_ListTopicSubscriptionsResponse_descriptor, + new java.lang.String[] { "Subscriptions", }); + internal_static_spec_proto_runtime_v1_TopicSubscription_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_spec_proto_runtime_v1_TopicSubscription_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_TopicSubscription_descriptor, + new java.lang.String[] { "PubsubName", "Topic", "Metadata", }); + internal_static_spec_proto_runtime_v1_TopicSubscription_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_TopicSubscription_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_TopicSubscription_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_TopicSubscription_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + com.google.protobuf.EmptyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/spec/src/main/java/spec/proto/runtime/v1/RuntimeGrpc.java b/spec/src/main/java/spec/proto/runtime/v1/RuntimeGrpc.java new file mode 100644 index 0000000..9e194c5 --- /dev/null +++ b/spec/src/main/java/spec/proto/runtime/v1/RuntimeGrpc.java @@ -0,0 +1,2048 @@ +package spec.proto.runtime.v1; + +import static io.grpc.MethodDescriptor.generateFullMethodName; +import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; +import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; +import static io.grpc.stub.ClientCalls.asyncUnaryCall; +import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; +import static io.grpc.stub.ClientCalls.blockingUnaryCall; +import static io.grpc.stub.ClientCalls.futureUnaryCall; +import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; +import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; +import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnaryCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; +import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; + +/** + */ +@javax.annotation.Generated( + value = "by gRPC proto compiler (version 1.34.1)", + comments = "Source: proto/runtime/v1/runtime.proto") +public final class RuntimeGrpc { + + private RuntimeGrpc() {} + + public static final String SERVICE_NAME = "spec.proto.runtime.v1.Runtime"; + + // Static method descriptors that strictly reflect the proto. + private static volatile io.grpc.MethodDescriptor getSayHelloMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SayHello", + requestType = spec.proto.runtime.v1.RuntimeProto.SayHelloRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.SayHelloResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSayHelloMethod() { + io.grpc.MethodDescriptor getSayHelloMethod; + if ((getSayHelloMethod = RuntimeGrpc.getSayHelloMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getSayHelloMethod = RuntimeGrpc.getSayHelloMethod) == null) { + RuntimeGrpc.getSayHelloMethod = getSayHelloMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SayHello")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.SayHelloRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.SayHelloResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("SayHello")) + .build(); + } + } + } + return getSayHelloMethod; + } + + private static volatile io.grpc.MethodDescriptor getInvokeServiceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "InvokeService", + requestType = spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.InvokeResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getInvokeServiceMethod() { + io.grpc.MethodDescriptor getInvokeServiceMethod; + if ((getInvokeServiceMethod = RuntimeGrpc.getInvokeServiceMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getInvokeServiceMethod = RuntimeGrpc.getInvokeServiceMethod) == null) { + RuntimeGrpc.getInvokeServiceMethod = getInvokeServiceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "InvokeService")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.InvokeResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("InvokeService")) + .build(); + } + } + } + return getInvokeServiceMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetConfigurationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetConfiguration", + requestType = spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetConfigurationMethod() { + io.grpc.MethodDescriptor getGetConfigurationMethod; + if ((getGetConfigurationMethod = RuntimeGrpc.getGetConfigurationMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getGetConfigurationMethod = RuntimeGrpc.getGetConfigurationMethod) == null) { + RuntimeGrpc.getGetConfigurationMethod = getGetConfigurationMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetConfiguration")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("GetConfiguration")) + .build(); + } + } + } + return getGetConfigurationMethod; + } + + private static volatile io.grpc.MethodDescriptor getSaveConfigurationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SaveConfiguration", + requestType = spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSaveConfigurationMethod() { + io.grpc.MethodDescriptor getSaveConfigurationMethod; + if ((getSaveConfigurationMethod = RuntimeGrpc.getSaveConfigurationMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getSaveConfigurationMethod = RuntimeGrpc.getSaveConfigurationMethod) == null) { + RuntimeGrpc.getSaveConfigurationMethod = getSaveConfigurationMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SaveConfiguration")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("SaveConfiguration")) + .build(); + } + } + } + return getSaveConfigurationMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteConfigurationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteConfiguration", + requestType = spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteConfigurationMethod() { + io.grpc.MethodDescriptor getDeleteConfigurationMethod; + if ((getDeleteConfigurationMethod = RuntimeGrpc.getDeleteConfigurationMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getDeleteConfigurationMethod = RuntimeGrpc.getDeleteConfigurationMethod) == null) { + RuntimeGrpc.getDeleteConfigurationMethod = getDeleteConfigurationMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteConfiguration")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("DeleteConfiguration")) + .build(); + } + } + } + return getDeleteConfigurationMethod; + } + + private static volatile io.grpc.MethodDescriptor getSubscribeConfigurationMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SubscribeConfiguration", + requestType = spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + public static io.grpc.MethodDescriptor getSubscribeConfigurationMethod() { + io.grpc.MethodDescriptor getSubscribeConfigurationMethod; + if ((getSubscribeConfigurationMethod = RuntimeGrpc.getSubscribeConfigurationMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getSubscribeConfigurationMethod = RuntimeGrpc.getSubscribeConfigurationMethod) == null) { + RuntimeGrpc.getSubscribeConfigurationMethod = getSubscribeConfigurationMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SubscribeConfiguration")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("SubscribeConfiguration")) + .build(); + } + } + } + return getSubscribeConfigurationMethod; + } + + private static volatile io.grpc.MethodDescriptor getTryLockMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "TryLock", + requestType = spec.proto.runtime.v1.RuntimeProto.TryLockRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.TryLockResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getTryLockMethod() { + io.grpc.MethodDescriptor getTryLockMethod; + if ((getTryLockMethod = RuntimeGrpc.getTryLockMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getTryLockMethod = RuntimeGrpc.getTryLockMethod) == null) { + RuntimeGrpc.getTryLockMethod = getTryLockMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "TryLock")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.TryLockRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.TryLockResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("TryLock")) + .build(); + } + } + } + return getTryLockMethod; + } + + private static volatile io.grpc.MethodDescriptor getUnlockMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "Unlock", + requestType = spec.proto.runtime.v1.RuntimeProto.UnlockRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.UnlockResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getUnlockMethod() { + io.grpc.MethodDescriptor getUnlockMethod; + if ((getUnlockMethod = RuntimeGrpc.getUnlockMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getUnlockMethod = RuntimeGrpc.getUnlockMethod) == null) { + RuntimeGrpc.getUnlockMethod = getUnlockMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Unlock")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.UnlockRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.UnlockResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("Unlock")) + .build(); + } + } + } + return getUnlockMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetNextIdMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetNextId", + requestType = spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetNextIdMethod() { + io.grpc.MethodDescriptor getGetNextIdMethod; + if ((getGetNextIdMethod = RuntimeGrpc.getGetNextIdMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getGetNextIdMethod = RuntimeGrpc.getGetNextIdMethod) == null) { + RuntimeGrpc.getGetNextIdMethod = getGetNextIdMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetNextId")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("GetNextId")) + .build(); + } + } + } + return getGetNextIdMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetStateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetState", + requestType = spec.proto.runtime.v1.RuntimeProto.GetStateRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.GetStateResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetStateMethod() { + io.grpc.MethodDescriptor getGetStateMethod; + if ((getGetStateMethod = RuntimeGrpc.getGetStateMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getGetStateMethod = RuntimeGrpc.getGetStateMethod) == null) { + RuntimeGrpc.getGetStateMethod = getGetStateMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetState")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetStateRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetStateResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("GetState")) + .build(); + } + } + } + return getGetStateMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetBulkStateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetBulkState", + requestType = spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetBulkStateMethod() { + io.grpc.MethodDescriptor getGetBulkStateMethod; + if ((getGetBulkStateMethod = RuntimeGrpc.getGetBulkStateMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getGetBulkStateMethod = RuntimeGrpc.getGetBulkStateMethod) == null) { + RuntimeGrpc.getGetBulkStateMethod = getGetBulkStateMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetBulkState")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("GetBulkState")) + .build(); + } + } + } + return getGetBulkStateMethod; + } + + private static volatile io.grpc.MethodDescriptor getSaveStateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "SaveState", + requestType = spec.proto.runtime.v1.RuntimeProto.SaveStateRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getSaveStateMethod() { + io.grpc.MethodDescriptor getSaveStateMethod; + if ((getSaveStateMethod = RuntimeGrpc.getSaveStateMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getSaveStateMethod = RuntimeGrpc.getSaveStateMethod) == null) { + RuntimeGrpc.getSaveStateMethod = getSaveStateMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "SaveState")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.SaveStateRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("SaveState")) + .build(); + } + } + } + return getSaveStateMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteStateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteState", + requestType = spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteStateMethod() { + io.grpc.MethodDescriptor getDeleteStateMethod; + if ((getDeleteStateMethod = RuntimeGrpc.getDeleteStateMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getDeleteStateMethod = RuntimeGrpc.getDeleteStateMethod) == null) { + RuntimeGrpc.getDeleteStateMethod = getDeleteStateMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteState")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("DeleteState")) + .build(); + } + } + } + return getDeleteStateMethod; + } + + private static volatile io.grpc.MethodDescriptor getDeleteBulkStateMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DeleteBulkState", + requestType = spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDeleteBulkStateMethod() { + io.grpc.MethodDescriptor getDeleteBulkStateMethod; + if ((getDeleteBulkStateMethod = RuntimeGrpc.getDeleteBulkStateMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getDeleteBulkStateMethod = RuntimeGrpc.getDeleteBulkStateMethod) == null) { + RuntimeGrpc.getDeleteBulkStateMethod = getDeleteBulkStateMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DeleteBulkState")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("DeleteBulkState")) + .build(); + } + } + } + return getDeleteBulkStateMethod; + } + + private static volatile io.grpc.MethodDescriptor getExecuteStateTransactionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ExecuteStateTransaction", + requestType = spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getExecuteStateTransactionMethod() { + io.grpc.MethodDescriptor getExecuteStateTransactionMethod; + if ((getExecuteStateTransactionMethod = RuntimeGrpc.getExecuteStateTransactionMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getExecuteStateTransactionMethod = RuntimeGrpc.getExecuteStateTransactionMethod) == null) { + RuntimeGrpc.getExecuteStateTransactionMethod = getExecuteStateTransactionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ExecuteStateTransaction")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("ExecuteStateTransaction")) + .build(); + } + } + } + return getExecuteStateTransactionMethod; + } + + private static volatile io.grpc.MethodDescriptor getPublishEventMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PublishEvent", + requestType = spec.proto.runtime.v1.RuntimeProto.PublishEventRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getPublishEventMethod() { + io.grpc.MethodDescriptor getPublishEventMethod; + if ((getPublishEventMethod = RuntimeGrpc.getPublishEventMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getPublishEventMethod = RuntimeGrpc.getPublishEventMethod) == null) { + RuntimeGrpc.getPublishEventMethod = getPublishEventMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PublishEvent")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.PublishEventRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("PublishEvent")) + .build(); + } + } + } + return getPublishEventMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetFileMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFile", + requestType = spec.proto.runtime.v1.RuntimeProto.GetFileRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.GetFileResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + public static io.grpc.MethodDescriptor getGetFileMethod() { + io.grpc.MethodDescriptor getGetFileMethod; + if ((getGetFileMethod = RuntimeGrpc.getGetFileMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getGetFileMethod = RuntimeGrpc.getGetFileMethod) == null) { + RuntimeGrpc.getGetFileMethod = getGetFileMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFile")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetFileRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetFileResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("GetFile")) + .build(); + } + } + } + return getGetFileMethod; + } + + private static volatile io.grpc.MethodDescriptor getPutFileMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "PutFile", + requestType = spec.proto.runtime.v1.RuntimeProto.PutFileRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + public static io.grpc.MethodDescriptor getPutFileMethod() { + io.grpc.MethodDescriptor getPutFileMethod; + if ((getPutFileMethod = RuntimeGrpc.getPutFileMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getPutFileMethod = RuntimeGrpc.getPutFileMethod) == null) { + RuntimeGrpc.getPutFileMethod = getPutFileMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "PutFile")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.PutFileRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("PutFile")) + .build(); + } + } + } + return getPutFileMethod; + } + + private static volatile io.grpc.MethodDescriptor getListFileMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "ListFile", + requestType = spec.proto.runtime.v1.RuntimeProto.ListFileRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.ListFileResp.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getListFileMethod() { + io.grpc.MethodDescriptor getListFileMethod; + if ((getListFileMethod = RuntimeGrpc.getListFileMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getListFileMethod = RuntimeGrpc.getListFileMethod) == null) { + RuntimeGrpc.getListFileMethod = getListFileMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "ListFile")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.ListFileRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.ListFileResp.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("ListFile")) + .build(); + } + } + } + return getListFileMethod; + } + + private static volatile io.grpc.MethodDescriptor getDelFileMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "DelFile", + requestType = spec.proto.runtime.v1.RuntimeProto.DelFileRequest.class, + responseType = com.google.protobuf.Empty.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getDelFileMethod() { + io.grpc.MethodDescriptor getDelFileMethod; + if ((getDelFileMethod = RuntimeGrpc.getDelFileMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getDelFileMethod = RuntimeGrpc.getDelFileMethod) == null) { + RuntimeGrpc.getDelFileMethod = getDelFileMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "DelFile")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.DelFileRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + com.google.protobuf.Empty.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("DelFile")) + .build(); + } + } + } + return getDelFileMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetFileMetaMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "GetFileMeta", + requestType = spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetFileMetaMethod() { + io.grpc.MethodDescriptor getGetFileMetaMethod; + if ((getGetFileMetaMethod = RuntimeGrpc.getGetFileMetaMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getGetFileMetaMethod = RuntimeGrpc.getGetFileMetaMethod) == null) { + RuntimeGrpc.getGetFileMetaMethod = getGetFileMetaMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "GetFileMeta")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("GetFileMeta")) + .build(); + } + } + } + return getGetFileMetaMethod; + } + + private static volatile io.grpc.MethodDescriptor getInvokeBindingMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "InvokeBinding", + requestType = spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest.class, + responseType = spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getInvokeBindingMethod() { + io.grpc.MethodDescriptor getInvokeBindingMethod; + if ((getInvokeBindingMethod = RuntimeGrpc.getInvokeBindingMethod) == null) { + synchronized (RuntimeGrpc.class) { + if ((getInvokeBindingMethod = RuntimeGrpc.getInvokeBindingMethod) == null) { + RuntimeGrpc.getInvokeBindingMethod = getInvokeBindingMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "InvokeBinding")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse.getDefaultInstance())) + .setSchemaDescriptor(new RuntimeMethodDescriptorSupplier("InvokeBinding")) + .build(); + } + } + } + return getInvokeBindingMethod; + } + + /** + * Creates a new async stub that supports all call types for the service + */ + public static RuntimeStub newStub(io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RuntimeStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeStub(channel, callOptions); + } + }; + return RuntimeStub.newStub(factory, channel); + } + + /** + * Creates a new blocking-style stub that supports unary and streaming output calls on the service + */ + public static RuntimeBlockingStub newBlockingStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RuntimeBlockingStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeBlockingStub(channel, callOptions); + } + }; + return RuntimeBlockingStub.newStub(factory, channel); + } + + /** + * Creates a new ListenableFuture-style stub that supports unary calls on the service + */ + public static RuntimeFutureStub newFutureStub( + io.grpc.Channel channel) { + io.grpc.stub.AbstractStub.StubFactory factory = + new io.grpc.stub.AbstractStub.StubFactory() { + @java.lang.Override + public RuntimeFutureStub newStub(io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeFutureStub(channel, callOptions); + } + }; + return RuntimeFutureStub.newStub(factory, channel); + } + + /** + */ + public static abstract class RuntimeImplBase implements io.grpc.BindableService { + + /** + *
+     *SayHello used for test
+     * 
+ */ + public void sayHello(spec.proto.runtime.v1.RuntimeProto.SayHelloRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSayHelloMethod(), responseObserver); + } + + /** + *
+     * InvokeService do rpc calls
+     * 
+ */ + public void invokeService(spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getInvokeServiceMethod(), responseObserver); + } + + /** + *
+     * GetConfiguration gets configuration from configuration store.
+     * 
+ */ + public void getConfiguration(spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetConfigurationMethod(), responseObserver); + } + + /** + *
+     * SaveConfiguration saves configuration into configuration store.
+     * 
+ */ + public void saveConfiguration(spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSaveConfigurationMethod(), responseObserver); + } + + /** + *
+     * DeleteConfiguration deletes configuration from configuration store.
+     * 
+ */ + public void deleteConfiguration(spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteConfigurationMethod(), responseObserver); + } + + /** + *
+     * SubscribeConfiguration gets configuration from configuration store and subscribe the updates.
+     * 
+ */ + public io.grpc.stub.StreamObserver subscribeConfiguration( + io.grpc.stub.StreamObserver responseObserver) { + return asyncUnimplementedStreamingCall(getSubscribeConfigurationMethod(), responseObserver); + } + + /** + *
+     * Distributed Lock API
+     * A non-blocking method trying to get a lock with ttl.
+     * 
+ */ + public void tryLock(spec.proto.runtime.v1.RuntimeProto.TryLockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getTryLockMethod(), responseObserver); + } + + /** + */ + public void unlock(spec.proto.runtime.v1.RuntimeProto.UnlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getUnlockMethod(), responseObserver); + } + + /** + *
+     * Sequencer API
+     * Get next unique id with some auto-increment guarantee
+     * 
+ */ + public void getNextId(spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetNextIdMethod(), responseObserver); + } + + /** + *
+     * Gets the state for a specific key.
+     * 
+ */ + public void getState(spec.proto.runtime.v1.RuntimeProto.GetStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetStateMethod(), responseObserver); + } + + /** + *
+     * Gets a bulk of state items for a list of keys
+     * 
+ */ + public void getBulkState(spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetBulkStateMethod(), responseObserver); + } + + /** + *
+     * Saves an array of state objects
+     * 
+ */ + public void saveState(spec.proto.runtime.v1.RuntimeProto.SaveStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getSaveStateMethod(), responseObserver); + } + + /** + *
+     * Deletes the state for a specific key.
+     * 
+ */ + public void deleteState(spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteStateMethod(), responseObserver); + } + + /** + *
+     * Deletes a bulk of state items for a list of keys
+     * 
+ */ + public void deleteBulkState(spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDeleteBulkStateMethod(), responseObserver); + } + + /** + *
+     * Executes transactions for a specified store
+     * 
+ */ + public void executeStateTransaction(spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getExecuteStateTransactionMethod(), responseObserver); + } + + /** + *
+     * Publishes events to the specific topic
+     * 
+ */ + public void publishEvent(spec.proto.runtime.v1.RuntimeProto.PublishEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getPublishEventMethod(), responseObserver); + } + + /** + *
+     * Get file with stream
+     * 
+ */ + public void getFile(spec.proto.runtime.v1.RuntimeProto.GetFileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetFileMethod(), responseObserver); + } + + /** + *
+     * Put file with stream
+     * 
+ */ + public io.grpc.stub.StreamObserver putFile( + io.grpc.stub.StreamObserver responseObserver) { + return asyncUnimplementedStreamingCall(getPutFileMethod(), responseObserver); + } + + /** + *
+     * List all files
+     * 
+ */ + public void listFile(spec.proto.runtime.v1.RuntimeProto.ListFileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getListFileMethod(), responseObserver); + } + + /** + *
+     * Delete specific file
+     * 
+ */ + public void delFile(spec.proto.runtime.v1.RuntimeProto.DelFileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getDelFileMethod(), responseObserver); + } + + /** + *
+     * Get file meta data, if file not exist,return code.NotFound error
+     * 
+ */ + public void getFileMeta(spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getGetFileMetaMethod(), responseObserver); + } + + /** + *
+     * Invokes binding data to specific output bindings
+     * 
+ */ + public void invokeBinding(spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnimplementedUnaryCall(getInvokeBindingMethod(), responseObserver); + } + + @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { + return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) + .addMethod( + getSayHelloMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.SayHelloRequest, + spec.proto.runtime.v1.RuntimeProto.SayHelloResponse>( + this, METHODID_SAY_HELLO))) + .addMethod( + getInvokeServiceMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest, + spec.proto.runtime.v1.RuntimeProto.InvokeResponse>( + this, METHODID_INVOKE_SERVICE))) + .addMethod( + getGetConfigurationMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest, + spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse>( + this, METHODID_GET_CONFIGURATION))) + .addMethod( + getSaveConfigurationMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest, + com.google.protobuf.Empty>( + this, METHODID_SAVE_CONFIGURATION))) + .addMethod( + getDeleteConfigurationMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_CONFIGURATION))) + .addMethod( + getSubscribeConfigurationMethod(), + asyncBidiStreamingCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest, + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse>( + this, METHODID_SUBSCRIBE_CONFIGURATION))) + .addMethod( + getTryLockMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.TryLockRequest, + spec.proto.runtime.v1.RuntimeProto.TryLockResponse>( + this, METHODID_TRY_LOCK))) + .addMethod( + getUnlockMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.UnlockRequest, + spec.proto.runtime.v1.RuntimeProto.UnlockResponse>( + this, METHODID_UNLOCK))) + .addMethod( + getGetNextIdMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest, + spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse>( + this, METHODID_GET_NEXT_ID))) + .addMethod( + getGetStateMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.GetStateRequest, + spec.proto.runtime.v1.RuntimeProto.GetStateResponse>( + this, METHODID_GET_STATE))) + .addMethod( + getGetBulkStateMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest, + spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse>( + this, METHODID_GET_BULK_STATE))) + .addMethod( + getSaveStateMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.SaveStateRequest, + com.google.protobuf.Empty>( + this, METHODID_SAVE_STATE))) + .addMethod( + getDeleteStateMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_STATE))) + .addMethod( + getDeleteBulkStateMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest, + com.google.protobuf.Empty>( + this, METHODID_DELETE_BULK_STATE))) + .addMethod( + getExecuteStateTransactionMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest, + com.google.protobuf.Empty>( + this, METHODID_EXECUTE_STATE_TRANSACTION))) + .addMethod( + getPublishEventMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.PublishEventRequest, + com.google.protobuf.Empty>( + this, METHODID_PUBLISH_EVENT))) + .addMethod( + getGetFileMethod(), + asyncServerStreamingCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.GetFileRequest, + spec.proto.runtime.v1.RuntimeProto.GetFileResponse>( + this, METHODID_GET_FILE))) + .addMethod( + getPutFileMethod(), + asyncClientStreamingCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.PutFileRequest, + com.google.protobuf.Empty>( + this, METHODID_PUT_FILE))) + .addMethod( + getListFileMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.ListFileRequest, + spec.proto.runtime.v1.RuntimeProto.ListFileResp>( + this, METHODID_LIST_FILE))) + .addMethod( + getDelFileMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.DelFileRequest, + com.google.protobuf.Empty>( + this, METHODID_DEL_FILE))) + .addMethod( + getGetFileMetaMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest, + spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse>( + this, METHODID_GET_FILE_META))) + .addMethod( + getInvokeBindingMethod(), + asyncUnaryCall( + new MethodHandlers< + spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest, + spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse>( + this, METHODID_INVOKE_BINDING))) + .build(); + } + } + + /** + */ + public static final class RuntimeStub extends io.grpc.stub.AbstractAsyncStub { + private RuntimeStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RuntimeStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeStub(channel, callOptions); + } + + /** + *
+     *SayHello used for test
+     * 
+ */ + public void sayHello(spec.proto.runtime.v1.RuntimeProto.SayHelloRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSayHelloMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * InvokeService do rpc calls
+     * 
+ */ + public void invokeService(spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getInvokeServiceMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * GetConfiguration gets configuration from configuration store.
+     * 
+ */ + public void getConfiguration(spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetConfigurationMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * SaveConfiguration saves configuration into configuration store.
+     * 
+ */ + public void saveConfiguration(spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSaveConfigurationMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * DeleteConfiguration deletes configuration from configuration store.
+     * 
+ */ + public void deleteConfiguration(spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteConfigurationMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * SubscribeConfiguration gets configuration from configuration store and subscribe the updates.
+     * 
+ */ + public io.grpc.stub.StreamObserver subscribeConfiguration( + io.grpc.stub.StreamObserver responseObserver) { + return asyncBidiStreamingCall( + getChannel().newCall(getSubscribeConfigurationMethod(), getCallOptions()), responseObserver); + } + + /** + *
+     * Distributed Lock API
+     * A non-blocking method trying to get a lock with ttl.
+     * 
+ */ + public void tryLock(spec.proto.runtime.v1.RuntimeProto.TryLockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getTryLockMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void unlock(spec.proto.runtime.v1.RuntimeProto.UnlockRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getUnlockMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Sequencer API
+     * Get next unique id with some auto-increment guarantee
+     * 
+ */ + public void getNextId(spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetNextIdMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets the state for a specific key.
+     * 
+ */ + public void getState(spec.proto.runtime.v1.RuntimeProto.GetStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetStateMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Gets a bulk of state items for a list of keys
+     * 
+ */ + public void getBulkState(spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetBulkStateMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Saves an array of state objects
+     * 
+ */ + public void saveState(spec.proto.runtime.v1.RuntimeProto.SaveStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getSaveStateMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes the state for a specific key.
+     * 
+ */ + public void deleteState(spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteStateMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Deletes a bulk of state items for a list of keys
+     * 
+ */ + public void deleteBulkState(spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDeleteBulkStateMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Executes transactions for a specified store
+     * 
+ */ + public void executeStateTransaction(spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getExecuteStateTransactionMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Publishes events to the specific topic
+     * 
+ */ + public void publishEvent(spec.proto.runtime.v1.RuntimeProto.PublishEventRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getPublishEventMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get file with stream
+     * 
+ */ + public void getFile(spec.proto.runtime.v1.RuntimeProto.GetFileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncServerStreamingCall( + getChannel().newCall(getGetFileMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Put file with stream
+     * 
+ */ + public io.grpc.stub.StreamObserver putFile( + io.grpc.stub.StreamObserver responseObserver) { + return asyncClientStreamingCall( + getChannel().newCall(getPutFileMethod(), getCallOptions()), responseObserver); + } + + /** + *
+     * List all files
+     * 
+ */ + public void listFile(spec.proto.runtime.v1.RuntimeProto.ListFileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getListFileMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Delete specific file
+     * 
+ */ + public void delFile(spec.proto.runtime.v1.RuntimeProto.DelFileRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getDelFileMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Get file meta data, if file not exist,return code.NotFound error
+     * 
+ */ + public void getFileMeta(spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getGetFileMetaMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     * Invokes binding data to specific output bindings
+     * 
+ */ + public void invokeBinding(spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest request, + io.grpc.stub.StreamObserver responseObserver) { + asyncUnaryCall( + getChannel().newCall(getInvokeBindingMethod(), getCallOptions()), request, responseObserver); + } + } + + /** + */ + public static final class RuntimeBlockingStub extends io.grpc.stub.AbstractBlockingStub { + private RuntimeBlockingStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RuntimeBlockingStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeBlockingStub(channel, callOptions); + } + + /** + *
+     *SayHello used for test
+     * 
+ */ + public spec.proto.runtime.v1.RuntimeProto.SayHelloResponse sayHello(spec.proto.runtime.v1.RuntimeProto.SayHelloRequest request) { + return blockingUnaryCall( + getChannel(), getSayHelloMethod(), getCallOptions(), request); + } + + /** + *
+     * InvokeService do rpc calls
+     * 
+ */ + public spec.proto.runtime.v1.RuntimeProto.InvokeResponse invokeService(spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest request) { + return blockingUnaryCall( + getChannel(), getInvokeServiceMethod(), getCallOptions(), request); + } + + /** + *
+     * GetConfiguration gets configuration from configuration store.
+     * 
+ */ + public spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse getConfiguration(spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest request) { + return blockingUnaryCall( + getChannel(), getGetConfigurationMethod(), getCallOptions(), request); + } + + /** + *
+     * SaveConfiguration saves configuration into configuration store.
+     * 
+ */ + public com.google.protobuf.Empty saveConfiguration(spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest request) { + return blockingUnaryCall( + getChannel(), getSaveConfigurationMethod(), getCallOptions(), request); + } + + /** + *
+     * DeleteConfiguration deletes configuration from configuration store.
+     * 
+ */ + public com.google.protobuf.Empty deleteConfiguration(spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteConfigurationMethod(), getCallOptions(), request); + } + + /** + *
+     * Distributed Lock API
+     * A non-blocking method trying to get a lock with ttl.
+     * 
+ */ + public spec.proto.runtime.v1.RuntimeProto.TryLockResponse tryLock(spec.proto.runtime.v1.RuntimeProto.TryLockRequest request) { + return blockingUnaryCall( + getChannel(), getTryLockMethod(), getCallOptions(), request); + } + + /** + */ + public spec.proto.runtime.v1.RuntimeProto.UnlockResponse unlock(spec.proto.runtime.v1.RuntimeProto.UnlockRequest request) { + return blockingUnaryCall( + getChannel(), getUnlockMethod(), getCallOptions(), request); + } + + /** + *
+     * Sequencer API
+     * Get next unique id with some auto-increment guarantee
+     * 
+ */ + public spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse getNextId(spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest request) { + return blockingUnaryCall( + getChannel(), getGetNextIdMethod(), getCallOptions(), request); + } + + /** + *
+     * Gets the state for a specific key.
+     * 
+ */ + public spec.proto.runtime.v1.RuntimeProto.GetStateResponse getState(spec.proto.runtime.v1.RuntimeProto.GetStateRequest request) { + return blockingUnaryCall( + getChannel(), getGetStateMethod(), getCallOptions(), request); + } + + /** + *
+     * Gets a bulk of state items for a list of keys
+     * 
+ */ + public spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse getBulkState(spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest request) { + return blockingUnaryCall( + getChannel(), getGetBulkStateMethod(), getCallOptions(), request); + } + + /** + *
+     * Saves an array of state objects
+     * 
+ */ + public com.google.protobuf.Empty saveState(spec.proto.runtime.v1.RuntimeProto.SaveStateRequest request) { + return blockingUnaryCall( + getChannel(), getSaveStateMethod(), getCallOptions(), request); + } + + /** + *
+     * Deletes the state for a specific key.
+     * 
+ */ + public com.google.protobuf.Empty deleteState(spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteStateMethod(), getCallOptions(), request); + } + + /** + *
+     * Deletes a bulk of state items for a list of keys
+     * 
+ */ + public com.google.protobuf.Empty deleteBulkState(spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest request) { + return blockingUnaryCall( + getChannel(), getDeleteBulkStateMethod(), getCallOptions(), request); + } + + /** + *
+     * Executes transactions for a specified store
+     * 
+ */ + public com.google.protobuf.Empty executeStateTransaction(spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest request) { + return blockingUnaryCall( + getChannel(), getExecuteStateTransactionMethod(), getCallOptions(), request); + } + + /** + *
+     * Publishes events to the specific topic
+     * 
+ */ + public com.google.protobuf.Empty publishEvent(spec.proto.runtime.v1.RuntimeProto.PublishEventRequest request) { + return blockingUnaryCall( + getChannel(), getPublishEventMethod(), getCallOptions(), request); + } + + /** + *
+     * Get file with stream
+     * 
+ */ + public java.util.Iterator getFile( + spec.proto.runtime.v1.RuntimeProto.GetFileRequest request) { + return blockingServerStreamingCall( + getChannel(), getGetFileMethod(), getCallOptions(), request); + } + + /** + *
+     * List all files
+     * 
+ */ + public spec.proto.runtime.v1.RuntimeProto.ListFileResp listFile(spec.proto.runtime.v1.RuntimeProto.ListFileRequest request) { + return blockingUnaryCall( + getChannel(), getListFileMethod(), getCallOptions(), request); + } + + /** + *
+     * Delete specific file
+     * 
+ */ + public com.google.protobuf.Empty delFile(spec.proto.runtime.v1.RuntimeProto.DelFileRequest request) { + return blockingUnaryCall( + getChannel(), getDelFileMethod(), getCallOptions(), request); + } + + /** + *
+     * Get file meta data, if file not exist,return code.NotFound error
+     * 
+ */ + public spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse getFileMeta(spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest request) { + return blockingUnaryCall( + getChannel(), getGetFileMetaMethod(), getCallOptions(), request); + } + + /** + *
+     * Invokes binding data to specific output bindings
+     * 
+ */ + public spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse invokeBinding(spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest request) { + return blockingUnaryCall( + getChannel(), getInvokeBindingMethod(), getCallOptions(), request); + } + } + + /** + */ + public static final class RuntimeFutureStub extends io.grpc.stub.AbstractFutureStub { + private RuntimeFutureStub( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + super(channel, callOptions); + } + + @java.lang.Override + protected RuntimeFutureStub build( + io.grpc.Channel channel, io.grpc.CallOptions callOptions) { + return new RuntimeFutureStub(channel, callOptions); + } + + /** + *
+     *SayHello used for test
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture sayHello( + spec.proto.runtime.v1.RuntimeProto.SayHelloRequest request) { + return futureUnaryCall( + getChannel().newCall(getSayHelloMethod(), getCallOptions()), request); + } + + /** + *
+     * InvokeService do rpc calls
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture invokeService( + spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest request) { + return futureUnaryCall( + getChannel().newCall(getInvokeServiceMethod(), getCallOptions()), request); + } + + /** + *
+     * GetConfiguration gets configuration from configuration store.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getConfiguration( + spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetConfigurationMethod(), getCallOptions()), request); + } + + /** + *
+     * SaveConfiguration saves configuration into configuration store.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture saveConfiguration( + spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest request) { + return futureUnaryCall( + getChannel().newCall(getSaveConfigurationMethod(), getCallOptions()), request); + } + + /** + *
+     * DeleteConfiguration deletes configuration from configuration store.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteConfiguration( + spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteConfigurationMethod(), getCallOptions()), request); + } + + /** + *
+     * Distributed Lock API
+     * A non-blocking method trying to get a lock with ttl.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture tryLock( + spec.proto.runtime.v1.RuntimeProto.TryLockRequest request) { + return futureUnaryCall( + getChannel().newCall(getTryLockMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture unlock( + spec.proto.runtime.v1.RuntimeProto.UnlockRequest request) { + return futureUnaryCall( + getChannel().newCall(getUnlockMethod(), getCallOptions()), request); + } + + /** + *
+     * Sequencer API
+     * Get next unique id with some auto-increment guarantee
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getNextId( + spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetNextIdMethod(), getCallOptions()), request); + } + + /** + *
+     * Gets the state for a specific key.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getState( + spec.proto.runtime.v1.RuntimeProto.GetStateRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetStateMethod(), getCallOptions()), request); + } + + /** + *
+     * Gets a bulk of state items for a list of keys
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getBulkState( + spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetBulkStateMethod(), getCallOptions()), request); + } + + /** + *
+     * Saves an array of state objects
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture saveState( + spec.proto.runtime.v1.RuntimeProto.SaveStateRequest request) { + return futureUnaryCall( + getChannel().newCall(getSaveStateMethod(), getCallOptions()), request); + } + + /** + *
+     * Deletes the state for a specific key.
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteState( + spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteStateMethod(), getCallOptions()), request); + } + + /** + *
+     * Deletes a bulk of state items for a list of keys
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture deleteBulkState( + spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest request) { + return futureUnaryCall( + getChannel().newCall(getDeleteBulkStateMethod(), getCallOptions()), request); + } + + /** + *
+     * Executes transactions for a specified store
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture executeStateTransaction( + spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest request) { + return futureUnaryCall( + getChannel().newCall(getExecuteStateTransactionMethod(), getCallOptions()), request); + } + + /** + *
+     * Publishes events to the specific topic
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture publishEvent( + spec.proto.runtime.v1.RuntimeProto.PublishEventRequest request) { + return futureUnaryCall( + getChannel().newCall(getPublishEventMethod(), getCallOptions()), request); + } + + /** + *
+     * List all files
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture listFile( + spec.proto.runtime.v1.RuntimeProto.ListFileRequest request) { + return futureUnaryCall( + getChannel().newCall(getListFileMethod(), getCallOptions()), request); + } + + /** + *
+     * Delete specific file
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture delFile( + spec.proto.runtime.v1.RuntimeProto.DelFileRequest request) { + return futureUnaryCall( + getChannel().newCall(getDelFileMethod(), getCallOptions()), request); + } + + /** + *
+     * Get file meta data, if file not exist,return code.NotFound error
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getFileMeta( + spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest request) { + return futureUnaryCall( + getChannel().newCall(getGetFileMetaMethod(), getCallOptions()), request); + } + + /** + *
+     * Invokes binding data to specific output bindings
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture invokeBinding( + spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest request) { + return futureUnaryCall( + getChannel().newCall(getInvokeBindingMethod(), getCallOptions()), request); + } + } + + private static final int METHODID_SAY_HELLO = 0; + private static final int METHODID_INVOKE_SERVICE = 1; + private static final int METHODID_GET_CONFIGURATION = 2; + private static final int METHODID_SAVE_CONFIGURATION = 3; + private static final int METHODID_DELETE_CONFIGURATION = 4; + private static final int METHODID_TRY_LOCK = 5; + private static final int METHODID_UNLOCK = 6; + private static final int METHODID_GET_NEXT_ID = 7; + private static final int METHODID_GET_STATE = 8; + private static final int METHODID_GET_BULK_STATE = 9; + private static final int METHODID_SAVE_STATE = 10; + private static final int METHODID_DELETE_STATE = 11; + private static final int METHODID_DELETE_BULK_STATE = 12; + private static final int METHODID_EXECUTE_STATE_TRANSACTION = 13; + private static final int METHODID_PUBLISH_EVENT = 14; + private static final int METHODID_GET_FILE = 15; + private static final int METHODID_LIST_FILE = 16; + private static final int METHODID_DEL_FILE = 17; + private static final int METHODID_GET_FILE_META = 18; + private static final int METHODID_INVOKE_BINDING = 19; + private static final int METHODID_SUBSCRIBE_CONFIGURATION = 20; + private static final int METHODID_PUT_FILE = 21; + + private static final class MethodHandlers implements + io.grpc.stub.ServerCalls.UnaryMethod, + io.grpc.stub.ServerCalls.ServerStreamingMethod, + io.grpc.stub.ServerCalls.ClientStreamingMethod, + io.grpc.stub.ServerCalls.BidiStreamingMethod { + private final RuntimeImplBase serviceImpl; + private final int methodId; + + MethodHandlers(RuntimeImplBase serviceImpl, int methodId) { + this.serviceImpl = serviceImpl; + this.methodId = methodId; + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_SAY_HELLO: + serviceImpl.sayHello((spec.proto.runtime.v1.RuntimeProto.SayHelloRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INVOKE_SERVICE: + serviceImpl.invokeService((spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_CONFIGURATION: + serviceImpl.getConfiguration((spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SAVE_CONFIGURATION: + serviceImpl.saveConfiguration((spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_CONFIGURATION: + serviceImpl.deleteConfiguration((spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_TRY_LOCK: + serviceImpl.tryLock((spec.proto.runtime.v1.RuntimeProto.TryLockRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_UNLOCK: + serviceImpl.unlock((spec.proto.runtime.v1.RuntimeProto.UnlockRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_NEXT_ID: + serviceImpl.getNextId((spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_STATE: + serviceImpl.getState((spec.proto.runtime.v1.RuntimeProto.GetStateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_BULK_STATE: + serviceImpl.getBulkState((spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_SAVE_STATE: + serviceImpl.saveState((spec.proto.runtime.v1.RuntimeProto.SaveStateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_STATE: + serviceImpl.deleteState((spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DELETE_BULK_STATE: + serviceImpl.deleteBulkState((spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_EXECUTE_STATE_TRANSACTION: + serviceImpl.executeStateTransaction((spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_PUBLISH_EVENT: + serviceImpl.publishEvent((spec.proto.runtime.v1.RuntimeProto.PublishEventRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_FILE: + serviceImpl.getFile((spec.proto.runtime.v1.RuntimeProto.GetFileRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_LIST_FILE: + serviceImpl.listFile((spec.proto.runtime.v1.RuntimeProto.ListFileRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_DEL_FILE: + serviceImpl.delFile((spec.proto.runtime.v1.RuntimeProto.DelFileRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_FILE_META: + serviceImpl.getFileMeta((spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_INVOKE_BINDING: + serviceImpl.invokeBinding((spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + default: + throw new AssertionError(); + } + } + + @java.lang.Override + @java.lang.SuppressWarnings("unchecked") + public io.grpc.stub.StreamObserver invoke( + io.grpc.stub.StreamObserver responseObserver) { + switch (methodId) { + case METHODID_SUBSCRIBE_CONFIGURATION: + return (io.grpc.stub.StreamObserver) serviceImpl.subscribeConfiguration( + (io.grpc.stub.StreamObserver) responseObserver); + case METHODID_PUT_FILE: + return (io.grpc.stub.StreamObserver) serviceImpl.putFile( + (io.grpc.stub.StreamObserver) responseObserver); + default: + throw new AssertionError(); + } + } + } + + private static abstract class RuntimeBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { + RuntimeBaseDescriptorSupplier() {} + + @java.lang.Override + public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.getDescriptor(); + } + + @java.lang.Override + public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { + return getFileDescriptor().findServiceByName("Runtime"); + } + } + + private static final class RuntimeFileDescriptorSupplier + extends RuntimeBaseDescriptorSupplier { + RuntimeFileDescriptorSupplier() {} + } + + private static final class RuntimeMethodDescriptorSupplier + extends RuntimeBaseDescriptorSupplier + implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { + private final String methodName; + + RuntimeMethodDescriptorSupplier(String methodName) { + this.methodName = methodName; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { + return getServiceDescriptor().findMethodByName(methodName); + } + } + + private static volatile io.grpc.ServiceDescriptor serviceDescriptor; + + public static io.grpc.ServiceDescriptor getServiceDescriptor() { + io.grpc.ServiceDescriptor result = serviceDescriptor; + if (result == null) { + synchronized (RuntimeGrpc.class) { + result = serviceDescriptor; + if (result == null) { + serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) + .setSchemaDescriptor(new RuntimeFileDescriptorSupplier()) + .addMethod(getSayHelloMethod()) + .addMethod(getInvokeServiceMethod()) + .addMethod(getGetConfigurationMethod()) + .addMethod(getSaveConfigurationMethod()) + .addMethod(getDeleteConfigurationMethod()) + .addMethod(getSubscribeConfigurationMethod()) + .addMethod(getTryLockMethod()) + .addMethod(getUnlockMethod()) + .addMethod(getGetNextIdMethod()) + .addMethod(getGetStateMethod()) + .addMethod(getGetBulkStateMethod()) + .addMethod(getSaveStateMethod()) + .addMethod(getDeleteStateMethod()) + .addMethod(getDeleteBulkStateMethod()) + .addMethod(getExecuteStateTransactionMethod()) + .addMethod(getPublishEventMethod()) + .addMethod(getGetFileMethod()) + .addMethod(getPutFileMethod()) + .addMethod(getListFileMethod()) + .addMethod(getDelFileMethod()) + .addMethod(getGetFileMetaMethod()) + .addMethod(getInvokeBindingMethod()) + .build(); + } + } + } + return result; + } +} diff --git a/spec/src/main/java/spec/proto/runtime/v1/RuntimeProto.java b/spec/src/main/java/spec/proto/runtime/v1/RuntimeProto.java new file mode 100644 index 0000000..92b8cd8 --- /dev/null +++ b/spec/src/main/java/spec/proto/runtime/v1/RuntimeProto.java @@ -0,0 +1,53700 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: proto/runtime/v1/runtime.proto + +package spec.proto.runtime.v1; + +public final class RuntimeProto { + private RuntimeProto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + public interface GetFileMetaRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetFileMetaRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return Whether the request field is set. + */ + boolean hasRequest(); + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return The request. + */ + spec.proto.runtime.v1.RuntimeProto.FileRequest getRequest(); + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder getRequestOrBuilder(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.GetFileMetaRequest} + */ + public static final class GetFileMetaRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetFileMetaRequest) + GetFileMetaRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFileMetaRequest.newBuilder() to construct. + private GetFileMetaRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetFileMetaRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetFileMetaRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetFileMetaRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.FileRequest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileMetaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileMetaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest.class, spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest.Builder.class); + } + + public static final int REQUEST_FIELD_NUMBER = 1; + private spec.proto.runtime.v1.RuntimeProto.FileRequest request_; + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return The request. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileRequest getRequest() { + return request_ == null ? spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance() : request_; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + 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 (request_ != null) { + output.writeMessage(1, getRequest()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (request_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRequest()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest other = (spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest() + .equals(other.getRequest())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest 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 spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest 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 spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest 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(spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest 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 spec.proto.runtime.v1.GetFileMetaRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetFileMetaRequest) + spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileMetaRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileMetaRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest.class, spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileMetaRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest build() { + spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest result = new spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest(this); + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.FileRequest request_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileRequest, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder, spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder> requestBuilder_; + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return The request. + */ + public spec.proto.runtime.v1.RuntimeProto.FileRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null ? spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance() : request_; + } else { + return requestBuilder_.getMessage(); + } + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder setRequest(spec.proto.runtime.v1.RuntimeProto.FileRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder setRequest( + spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder mergeRequest(spec.proto.runtime.v1.RuntimeProto.FileRequest value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = + spec.proto.runtime.v1.RuntimeProto.FileRequest.newBuilder(request_).mergeFrom(value).buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null ? + spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance() : request_; + } + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileRequest, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder, spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileRequest, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder, spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder>( + getRequest(), + getParentForChildren(), + isClean()); + request_ = null; + } + return requestBuilder_; + } + @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:spec.proto.runtime.v1.GetFileMetaRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetFileMetaRequest) + private static final spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFileMetaRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFileMetaRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileMetaRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetFileMetaResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetFileMetaResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The size of file
+     * 
+ * + * int64 size = 1; + * @return The size. + */ + long getSize(); + + /** + *
+     * The modified time of file
+     * 
+ * + * string last_modified = 2; + * @return The lastModified. + */ + java.lang.String getLastModified(); + /** + *
+     * The modified time of file
+     * 
+ * + * string last_modified = 2; + * @return The bytes for lastModified. + */ + com.google.protobuf.ByteString + getLastModifiedBytes(); + + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + * @return Whether the response field is set. + */ + boolean hasResponse(); + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + * @return The response. + */ + spec.proto.runtime.v1.RuntimeProto.FileMeta getResponse(); + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + */ + spec.proto.runtime.v1.RuntimeProto.FileMetaOrBuilder getResponseOrBuilder(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.GetFileMetaResponse} + */ + public static final class GetFileMetaResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetFileMetaResponse) + GetFileMetaResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFileMetaResponse.newBuilder() to construct. + private GetFileMetaResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetFileMetaResponse() { + lastModified_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetFileMetaResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetFileMetaResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + size_ = input.readInt64(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + lastModified_ = s; + break; + } + case 26: { + spec.proto.runtime.v1.RuntimeProto.FileMeta.Builder subBuilder = null; + if (response_ != null) { + subBuilder = response_.toBuilder(); + } + response_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.FileMeta.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(response_); + response_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileMetaResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileMetaResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse.class, spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse.Builder.class); + } + + public static final int SIZE_FIELD_NUMBER = 1; + private long size_; + /** + *
+     * The size of file
+     * 
+ * + * int64 size = 1; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + + public static final int LAST_MODIFIED_FIELD_NUMBER = 2; + private volatile java.lang.Object lastModified_; + /** + *
+     * The modified time of file
+     * 
+ * + * string last_modified = 2; + * @return The lastModified. + */ + @java.lang.Override + public java.lang.String getLastModified() { + java.lang.Object ref = lastModified_; + 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(); + lastModified_ = s; + return s; + } + } + /** + *
+     * The modified time of file
+     * 
+ * + * string last_modified = 2; + * @return The bytes for lastModified. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLastModifiedBytes() { + java.lang.Object ref = lastModified_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lastModified_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESPONSE_FIELD_NUMBER = 3; + private spec.proto.runtime.v1.RuntimeProto.FileMeta response_; + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + * @return Whether the response field is set. + */ + @java.lang.Override + public boolean hasResponse() { + return response_ != null; + } + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + * @return The response. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileMeta getResponse() { + return response_ == null ? spec.proto.runtime.v1.RuntimeProto.FileMeta.getDefaultInstance() : response_; + } + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileMetaOrBuilder getResponseOrBuilder() { + return getResponse(); + } + + 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 (size_ != 0L) { + output.writeInt64(1, size_); + } + if (!getLastModifiedBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, lastModified_); + } + if (response_ != null) { + output.writeMessage(3, getResponse()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (size_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, size_); + } + if (!getLastModifiedBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, lastModified_); + } + if (response_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getResponse()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse other = (spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse) obj; + + if (getSize() + != other.getSize()) return false; + if (!getLastModified() + .equals(other.getLastModified())) return false; + if (hasResponse() != other.hasResponse()) return false; + if (hasResponse()) { + if (!getResponse() + .equals(other.getResponse())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSize()); + hash = (37 * hash) + LAST_MODIFIED_FIELD_NUMBER; + hash = (53 * hash) + getLastModified().hashCode(); + if (hasResponse()) { + hash = (37 * hash) + RESPONSE_FIELD_NUMBER; + hash = (53 * hash) + getResponse().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse 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 spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse 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 spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse 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(spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse 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 spec.proto.runtime.v1.GetFileMetaResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetFileMetaResponse) + spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileMetaResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileMetaResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse.class, spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + size_ = 0L; + + lastModified_ = ""; + + if (responseBuilder_ == null) { + response_ = null; + } else { + response_ = null; + responseBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileMetaResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse build() { + spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse result = new spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse(this); + result.size_ = size_; + result.lastModified_ = lastModified_; + if (responseBuilder_ == null) { + result.response_ = response_; + } else { + result.response_ = responseBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse.getDefaultInstance()) return this; + if (other.getSize() != 0L) { + setSize(other.getSize()); + } + if (!other.getLastModified().isEmpty()) { + lastModified_ = other.lastModified_; + onChanged(); + } + if (other.hasResponse()) { + mergeResponse(other.getResponse()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long size_ ; + /** + *
+       * The size of file
+       * 
+ * + * int64 size = 1; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + /** + *
+       * The size of file
+       * 
+ * + * int64 size = 1; + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + + size_ = value; + onChanged(); + return this; + } + /** + *
+       * The size of file
+       * 
+ * + * int64 size = 1; + * @return This builder for chaining. + */ + public Builder clearSize() { + + size_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object lastModified_ = ""; + /** + *
+       * The modified time of file
+       * 
+ * + * string last_modified = 2; + * @return The lastModified. + */ + public java.lang.String getLastModified() { + java.lang.Object ref = lastModified_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lastModified_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The modified time of file
+       * 
+ * + * string last_modified = 2; + * @return The bytes for lastModified. + */ + public com.google.protobuf.ByteString + getLastModifiedBytes() { + java.lang.Object ref = lastModified_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lastModified_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The modified time of file
+       * 
+ * + * string last_modified = 2; + * @param value The lastModified to set. + * @return This builder for chaining. + */ + public Builder setLastModified( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lastModified_ = value; + onChanged(); + return this; + } + /** + *
+       * The modified time of file
+       * 
+ * + * string last_modified = 2; + * @return This builder for chaining. + */ + public Builder clearLastModified() { + + lastModified_ = getDefaultInstance().getLastModified(); + onChanged(); + return this; + } + /** + *
+       * The modified time of file
+       * 
+ * + * string last_modified = 2; + * @param value The bytes for lastModified to set. + * @return This builder for chaining. + */ + public Builder setLastModifiedBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lastModified_ = value; + onChanged(); + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.FileMeta response_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileMeta, spec.proto.runtime.v1.RuntimeProto.FileMeta.Builder, spec.proto.runtime.v1.RuntimeProto.FileMetaOrBuilder> responseBuilder_; + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + * @return Whether the response field is set. + */ + public boolean hasResponse() { + return responseBuilder_ != null || response_ != null; + } + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + * @return The response. + */ + public spec.proto.runtime.v1.RuntimeProto.FileMeta getResponse() { + if (responseBuilder_ == null) { + return response_ == null ? spec.proto.runtime.v1.RuntimeProto.FileMeta.getDefaultInstance() : response_; + } else { + return responseBuilder_.getMessage(); + } + } + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + */ + public Builder setResponse(spec.proto.runtime.v1.RuntimeProto.FileMeta value) { + if (responseBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + response_ = value; + onChanged(); + } else { + responseBuilder_.setMessage(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + */ + public Builder setResponse( + spec.proto.runtime.v1.RuntimeProto.FileMeta.Builder builderForValue) { + if (responseBuilder_ == null) { + response_ = builderForValue.build(); + onChanged(); + } else { + responseBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + */ + public Builder mergeResponse(spec.proto.runtime.v1.RuntimeProto.FileMeta value) { + if (responseBuilder_ == null) { + if (response_ != null) { + response_ = + spec.proto.runtime.v1.RuntimeProto.FileMeta.newBuilder(response_).mergeFrom(value).buildPartial(); + } else { + response_ = value; + } + onChanged(); + } else { + responseBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + */ + public Builder clearResponse() { + if (responseBuilder_ == null) { + response_ = null; + onChanged(); + } else { + response_ = null; + responseBuilder_ = null; + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.FileMeta.Builder getResponseBuilder() { + + onChanged(); + return getResponseFieldBuilder().getBuilder(); + } + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.FileMetaOrBuilder getResponseOrBuilder() { + if (responseBuilder_ != null) { + return responseBuilder_.getMessageOrBuilder(); + } else { + return response_ == null ? + spec.proto.runtime.v1.RuntimeProto.FileMeta.getDefaultInstance() : response_; + } + } + /** + * .spec.proto.runtime.v1.FileMeta response = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileMeta, spec.proto.runtime.v1.RuntimeProto.FileMeta.Builder, spec.proto.runtime.v1.RuntimeProto.FileMetaOrBuilder> + getResponseFieldBuilder() { + if (responseBuilder_ == null) { + responseBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileMeta, spec.proto.runtime.v1.RuntimeProto.FileMeta.Builder, spec.proto.runtime.v1.RuntimeProto.FileMetaOrBuilder>( + getResponse(), + getParentForChildren(), + isClean()); + response_ = null; + } + return responseBuilder_; + } + @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:spec.proto.runtime.v1.GetFileMetaResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetFileMetaResponse) + private static final spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFileMetaResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFileMetaResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileMetaResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FileMetaValueOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.FileMetaValue) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string value = 1; + * @return A list containing the value. + */ + java.util.List + getValueList(); + /** + * repeated string value = 1; + * @return The count of value. + */ + int getValueCount(); + /** + * repeated string value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + java.lang.String getValue(int index); + /** + * repeated string value = 1; + * @param index The index of the value to return. + * @return The bytes of the value at the given index. + */ + com.google.protobuf.ByteString + getValueBytes(int index); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.FileMetaValue} + */ + public static final class FileMetaValue extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.FileMetaValue) + FileMetaValueOrBuilder { + private static final long serialVersionUID = 0L; + // Use FileMetaValue.newBuilder() to construct. + private FileMetaValue(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FileMetaValue() { + value_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new FileMetaValue(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FileMetaValue( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + value_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + value_.add(s); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + value_ = value_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMetaValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMetaValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.FileMetaValue.class, spec.proto.runtime.v1.RuntimeProto.FileMetaValue.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private com.google.protobuf.LazyStringList value_; + /** + * repeated string value = 1; + * @return A list containing the value. + */ + public com.google.protobuf.ProtocolStringList + getValueList() { + return value_; + } + /** + * repeated string value = 1; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated string value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public java.lang.String getValue(int index) { + return value_.get(index); + } + /** + * repeated string value = 1; + * @param index The index of the value to return. + * @return The bytes of the value at the given index. + */ + public com.google.protobuf.ByteString + getValueBytes(int index) { + return value_.getByteString(index); + } + + 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 < value_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_.getRaw(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < value_.size(); i++) { + dataSize += computeStringSizeNoTag(value_.getRaw(i)); + } + size += dataSize; + size += 1 * getValueList().size(); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.FileMetaValue)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.FileMetaValue other = (spec.proto.runtime.v1.RuntimeProto.FileMetaValue) obj; + + if (!getValueList() + .equals(other.getValueList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValueCount() > 0) { + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValueList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue 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 spec.proto.runtime.v1.RuntimeProto.FileMetaValue parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue 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 spec.proto.runtime.v1.RuntimeProto.FileMetaValue parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue 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(spec.proto.runtime.v1.RuntimeProto.FileMetaValue 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 spec.proto.runtime.v1.FileMetaValue} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.FileMetaValue) + spec.proto.runtime.v1.RuntimeProto.FileMetaValueOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMetaValue_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMetaValue_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.FileMetaValue.class, spec.proto.runtime.v1.RuntimeProto.FileMetaValue.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.FileMetaValue.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMetaValue_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileMetaValue getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.FileMetaValue.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileMetaValue build() { + spec.proto.runtime.v1.RuntimeProto.FileMetaValue result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileMetaValue buildPartial() { + spec.proto.runtime.v1.RuntimeProto.FileMetaValue result = new spec.proto.runtime.v1.RuntimeProto.FileMetaValue(this); + int from_bitField0_ = bitField0_; + if (((bitField0_ & 0x00000001) != 0)) { + value_ = value_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.value_ = value_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.FileMetaValue) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.FileMetaValue)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.FileMetaValue other) { + if (other == spec.proto.runtime.v1.RuntimeProto.FileMetaValue.getDefaultInstance()) return this; + if (!other.value_.isEmpty()) { + if (value_.isEmpty()) { + value_ = other.value_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureValueIsMutable(); + value_.addAll(other.value_); + } + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.FileMetaValue parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.FileMetaValue) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.LazyStringList value_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureValueIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + value_ = new com.google.protobuf.LazyStringArrayList(value_); + bitField0_ |= 0x00000001; + } + } + /** + * repeated string value = 1; + * @return A list containing the value. + */ + public com.google.protobuf.ProtocolStringList + getValueList() { + return value_.getUnmodifiableView(); + } + /** + * repeated string value = 1; + * @return The count of value. + */ + public int getValueCount() { + return value_.size(); + } + /** + * repeated string value = 1; + * @param index The index of the element to return. + * @return The value at the given index. + */ + public java.lang.String getValue(int index) { + return value_.get(index); + } + /** + * repeated string value = 1; + * @param index The index of the value to return. + * @return The bytes of the value at the given index. + */ + public com.google.protobuf.ByteString + getValueBytes(int index) { + return value_.getByteString(index); + } + /** + * repeated string value = 1; + * @param index The index to set the value at. + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueIsMutable(); + value_.set(index, value); + onChanged(); + return this; + } + /** + * repeated string value = 1; + * @param value The value to add. + * @return This builder for chaining. + */ + public Builder addValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureValueIsMutable(); + value_.add(value); + onChanged(); + return this; + } + /** + * repeated string value = 1; + * @param values The value to add. + * @return This builder for chaining. + */ + public Builder addAllValue( + java.lang.Iterable values) { + ensureValueIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, value_); + onChanged(); + return this; + } + /** + * repeated string value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + value_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * repeated string value = 1; + * @param value The bytes of the value to add. + * @return This builder for chaining. + */ + public Builder addValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureValueIsMutable(); + value_.add(value); + 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:spec.proto.runtime.v1.FileMetaValue) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.FileMetaValue) + private static final spec.proto.runtime.v1.RuntimeProto.FileMetaValue DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.FileMetaValue(); + } + + public static spec.proto.runtime.v1.RuntimeProto.FileMetaValue getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileMetaValue parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FileMetaValue(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileMetaValue getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FileMetaOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.FileMeta) + com.google.protobuf.MessageOrBuilder { + + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + int getMetadataCount(); + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + java.util.Map + getMetadataMap(); + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + + spec.proto.runtime.v1.RuntimeProto.FileMetaValue getMetadataOrDefault( + java.lang.String key, + spec.proto.runtime.v1.RuntimeProto.FileMetaValue defaultValue); + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + + spec.proto.runtime.v1.RuntimeProto.FileMetaValue getMetadataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.FileMeta} + */ + public static final class FileMeta extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.FileMeta) + FileMetaOrBuilder { + private static final long serialVersionUID = 0L; + // Use FileMeta.newBuilder() to construct. + private FileMeta(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FileMeta() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new FileMeta(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FileMeta( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMeta_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMeta_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.FileMeta.class, spec.proto.runtime.v1.RuntimeProto.FileMeta.Builder.class); + } + + public static final int METADATA_FIELD_NUMBER = 1; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, spec.proto.runtime.v1.RuntimeProto.FileMetaValue> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMeta_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.MESSAGE, + spec.proto.runtime.v1.RuntimeProto.FileMetaValue.getDefaultInstance()); + } + private com.google.protobuf.MapField< + java.lang.String, spec.proto.runtime.v1.RuntimeProto.FileMetaValue> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + @java.lang.Override + + public spec.proto.runtime.v1.RuntimeProto.FileMetaValue getMetadataOrDefault( + java.lang.String key, + spec.proto.runtime.v1.RuntimeProto.FileMetaValue defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + @java.lang.Override + + public spec.proto.runtime.v1.RuntimeProto.FileMetaValue getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 { + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 1); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.FileMeta)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.FileMeta other = (spec.proto.runtime.v1.RuntimeProto.FileMeta) obj; + + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.FileMeta parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMeta parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMeta parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMeta parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMeta parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMeta parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMeta parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMeta 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 spec.proto.runtime.v1.RuntimeProto.FileMeta parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMeta 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 spec.proto.runtime.v1.RuntimeProto.FileMeta parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileMeta 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(spec.proto.runtime.v1.RuntimeProto.FileMeta 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 spec.proto.runtime.v1.FileMeta} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.FileMeta) + spec.proto.runtime.v1.RuntimeProto.FileMetaOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMeta_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMeta_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.FileMeta.class, spec.proto.runtime.v1.RuntimeProto.FileMeta.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.FileMeta.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileMeta_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileMeta getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.FileMeta.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileMeta build() { + spec.proto.runtime.v1.RuntimeProto.FileMeta result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileMeta buildPartial() { + spec.proto.runtime.v1.RuntimeProto.FileMeta result = new spec.proto.runtime.v1.RuntimeProto.FileMeta(this); + int from_bitField0_ = bitField0_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.FileMeta) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.FileMeta)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.FileMeta other) { + if (other == spec.proto.runtime.v1.RuntimeProto.FileMeta.getDefaultInstance()) return this; + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.FileMeta parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.FileMeta) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.String, spec.proto.runtime.v1.RuntimeProto.FileMetaValue> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + @java.lang.Override + + public spec.proto.runtime.v1.RuntimeProto.FileMetaValue getMetadataOrDefault( + java.lang.String key, + spec.proto.runtime.v1.RuntimeProto.FileMetaValue defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + @java.lang.Override + + public spec.proto.runtime.v1.RuntimeProto.FileMetaValue getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + public Builder putMetadata( + java.lang.String key, + spec.proto.runtime.v1.RuntimeProto.FileMetaValue value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + * map<string, .spec.proto.runtime.v1.FileMetaValue> metadata = 1; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.FileMeta) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.FileMeta) + private static final spec.proto.runtime.v1.RuntimeProto.FileMeta DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.FileMeta(); + } + + public static spec.proto.runtime.v1.RuntimeProto.FileMeta getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileMeta parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FileMeta(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileMeta getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetFileRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetFileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * The name of the file or object want to get.
+     * 
+ * + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + *
+     * The name of the file or object want to get.
+     * 
+ * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + int getMetadataCount(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.GetFileRequest} + */ + public static final class GetFileRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetFileRequest) + GetFileRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFileRequest.newBuilder() to construct. + private GetFileRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetFileRequest() { + storeName_ = ""; + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetFileRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetFileRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetFileRequest.class, spec.proto.runtime.v1.RuntimeProto.GetFileRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + *
+     * The name of the file or object want to get.
+     * 
+ * + * string name = 2; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+     * The name of the file or object want to get.
+     * 
+ * + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 3; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 3); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetFileRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetFileRequest other = (spec.proto.runtime.v1.RuntimeProto.GetFileRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getName() + .equals(other.getName())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest 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 spec.proto.runtime.v1.RuntimeProto.GetFileRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest 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 spec.proto.runtime.v1.RuntimeProto.GetFileRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest 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(spec.proto.runtime.v1.RuntimeProto.GetFileRequest 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 spec.proto.runtime.v1.GetFileRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetFileRequest) + spec.proto.runtime.v1.RuntimeProto.GetFileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetFileRequest.class, spec.proto.runtime.v1.RuntimeProto.GetFileRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetFileRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + name_ = ""; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetFileRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileRequest build() { + spec.proto.runtime.v1.RuntimeProto.GetFileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetFileRequest result = new spec.proto.runtime.v1.RuntimeProto.GetFileRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.name_ = name_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetFileRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetFileRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetFileRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetFileRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetFileRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetFileRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+       * The name of the file or object want to get.
+       * 
+ * + * string name = 2; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of the file or object want to get.
+       * 
+ * + * string name = 2; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of the file or object want to get.
+       * 
+ * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of the file or object want to get.
+       * 
+ * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+       * The name of the file or object want to get.
+       * 
+ * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.GetFileRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetFileRequest) + private static final spec.proto.runtime.v1.RuntimeProto.GetFileRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetFileRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetFileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFileRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetFileResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetFileResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * bytes data = 1; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.GetFileResponse} + */ + public static final class GetFileResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetFileResponse) + GetFileResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetFileResponse.newBuilder() to construct. + private GetFileResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetFileResponse() { + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetFileResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetFileResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + + data_ = input.readBytes(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetFileResponse.class, spec.proto.runtime.v1.RuntimeProto.GetFileResponse.Builder.class); + } + + public static final int DATA_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString data_; + /** + * bytes data = 1; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + 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 (!data_.isEmpty()) { + output.writeBytes(1, data_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, data_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetFileResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetFileResponse other = (spec.proto.runtime.v1.RuntimeProto.GetFileResponse) obj; + + if (!getData() + .equals(other.getData())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse 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 spec.proto.runtime.v1.RuntimeProto.GetFileResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse 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 spec.proto.runtime.v1.RuntimeProto.GetFileResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse 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(spec.proto.runtime.v1.RuntimeProto.GetFileResponse 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 spec.proto.runtime.v1.GetFileResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetFileResponse) + spec.proto.runtime.v1.RuntimeProto.GetFileResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetFileResponse.class, spec.proto.runtime.v1.RuntimeProto.GetFileResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetFileResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + data_ = com.google.protobuf.ByteString.EMPTY; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetFileResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetFileResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileResponse build() { + spec.proto.runtime.v1.RuntimeProto.GetFileResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetFileResponse result = new spec.proto.runtime.v1.RuntimeProto.GetFileResponse(this); + result.data_ = data_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetFileResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetFileResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetFileResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetFileResponse.getDefaultInstance()) return this; + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetFileResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetFileResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + * bytes data = 1; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + * bytes data = 1; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + * bytes data = 1; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + 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:spec.proto.runtime.v1.GetFileResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetFileResponse) + private static final spec.proto.runtime.v1.RuntimeProto.GetFileResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetFileResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetFileResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetFileResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetFileResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetFileResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PutFileRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.PutFileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * The name of the file or object want to put.
+     * 
+ * + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + *
+     * The name of the file or object want to put.
+     * 
+ * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+     * The data will be store.
+     * 
+ * + * bytes data = 3; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + int getMetadataCount(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.PutFileRequest} + */ + public static final class PutFileRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.PutFileRequest) + PutFileRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PutFileRequest.newBuilder() to construct. + private PutFileRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PutFileRequest() { + storeName_ = ""; + name_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PutFileRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PutFileRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + + data_ = input.readBytes(); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PutFileRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PutFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.PutFileRequest.class, spec.proto.runtime.v1.RuntimeProto.PutFileRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + *
+     * The name of the file or object want to put.
+     * 
+ * + * string name = 2; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+     * The name of the file or object want to put.
+     * 
+ * + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString data_; + /** + *
+     * The data will be store.
+     * 
+ * + * bytes data = 3; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int METADATA_FIELD_NUMBER = 4; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PutFileRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (!data_.isEmpty()) { + output.writeBytes(3, data_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 4); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, data_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.PutFileRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.PutFileRequest other = (spec.proto.runtime.v1.RuntimeProto.PutFileRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getName() + .equals(other.getName())) return false; + if (!getData() + .equals(other.getData())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest 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 spec.proto.runtime.v1.RuntimeProto.PutFileRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest 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 spec.proto.runtime.v1.RuntimeProto.PutFileRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest 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(spec.proto.runtime.v1.RuntimeProto.PutFileRequest 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 spec.proto.runtime.v1.PutFileRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.PutFileRequest) + spec.proto.runtime.v1.RuntimeProto.PutFileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PutFileRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PutFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.PutFileRequest.class, spec.proto.runtime.v1.RuntimeProto.PutFileRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.PutFileRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + name_ = ""; + + data_ = com.google.protobuf.ByteString.EMPTY; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PutFileRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.PutFileRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.PutFileRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.PutFileRequest build() { + spec.proto.runtime.v1.RuntimeProto.PutFileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.PutFileRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.PutFileRequest result = new spec.proto.runtime.v1.RuntimeProto.PutFileRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.name_ = name_; + result.data_ = data_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.PutFileRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.PutFileRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.PutFileRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.PutFileRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.PutFileRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.PutFileRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+       * The name of the file or object want to put.
+       * 
+ * + * string name = 2; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of the file or object want to put.
+       * 
+ * + * string name = 2; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of the file or object want to put.
+       * 
+ * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of the file or object want to put.
+       * 
+ * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+       * The name of the file or object want to put.
+       * 
+ * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The data will be store.
+       * 
+ * + * bytes data = 3; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+       * The data will be store.
+       * 
+ * + * bytes data = 3; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
+       * The data will be store.
+       * 
+ * + * bytes data = 3; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.PutFileRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.PutFileRequest) + private static final spec.proto.runtime.v1.RuntimeProto.PutFileRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.PutFileRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.PutFileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PutFileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PutFileRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.PutFileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FileRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.FileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * The name of the directory
+     * 
+ * + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + *
+     * The name of the directory
+     * 
+ * + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + int getMetadataCount(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.FileRequest} + */ + public static final class FileRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.FileRequest) + FileRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use FileRequest.newBuilder() to construct. + private FileRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FileRequest() { + storeName_ = ""; + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new FileRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FileRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.FileRequest.class, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + *
+     * The name of the directory
+     * 
+ * + * string name = 2; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+     * The name of the directory
+     * 
+ * + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 3; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 3); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.FileRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.FileRequest other = (spec.proto.runtime.v1.RuntimeProto.FileRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getName() + .equals(other.getName())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.FileRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileRequest 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 spec.proto.runtime.v1.RuntimeProto.FileRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileRequest 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 spec.proto.runtime.v1.RuntimeProto.FileRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileRequest 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(spec.proto.runtime.v1.RuntimeProto.FileRequest 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 spec.proto.runtime.v1.FileRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.FileRequest) + spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.FileRequest.class, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.FileRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + name_ = ""; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileRequest build() { + spec.proto.runtime.v1.RuntimeProto.FileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.FileRequest result = new spec.proto.runtime.v1.RuntimeProto.FileRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.name_ = name_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.FileRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.FileRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.FileRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.FileRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.FileRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + *
+       * The name of the directory
+       * 
+ * + * string name = 2; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of the directory
+       * 
+ * + * string name = 2; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of the directory
+       * 
+ * + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of the directory
+       * 
+ * + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+       * The name of the directory
+       * 
+ * + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.FileRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.FileRequest) + private static final spec.proto.runtime.v1.RuntimeProto.FileRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.FileRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.FileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FileRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ListFileRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.ListFileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return Whether the request field is set. + */ + boolean hasRequest(); + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return The request. + */ + spec.proto.runtime.v1.RuntimeProto.FileRequest getRequest(); + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder getRequestOrBuilder(); + + /** + * int32 page_size = 2; + * @return The pageSize. + */ + int getPageSize(); + + /** + * string marker = 3; + * @return The marker. + */ + java.lang.String getMarker(); + /** + * string marker = 3; + * @return The bytes for marker. + */ + com.google.protobuf.ByteString + getMarkerBytes(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.ListFileRequest} + */ + public static final class ListFileRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.ListFileRequest) + ListFileRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFileRequest.newBuilder() to construct. + private ListFileRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListFileRequest() { + marker_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListFileRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListFileRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.FileRequest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + case 16: { + + pageSize_ = input.readInt32(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + marker_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ListFileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ListFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.ListFileRequest.class, spec.proto.runtime.v1.RuntimeProto.ListFileRequest.Builder.class); + } + + public static final int REQUEST_FIELD_NUMBER = 1; + private spec.proto.runtime.v1.RuntimeProto.FileRequest request_; + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return The request. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileRequest getRequest() { + return request_ == null ? spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance() : request_; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + public static final int PAGE_SIZE_FIELD_NUMBER = 2; + private int pageSize_; + /** + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + + public static final int MARKER_FIELD_NUMBER = 3; + private volatile java.lang.Object marker_; + /** + * string marker = 3; + * @return The marker. + */ + @java.lang.Override + public java.lang.String getMarker() { + java.lang.Object ref = marker_; + 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(); + marker_ = s; + return s; + } + } + /** + * string marker = 3; + * @return The bytes for marker. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMarkerBytes() { + java.lang.Object ref = marker_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + marker_ = 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 (request_ != null) { + output.writeMessage(1, getRequest()); + } + if (pageSize_ != 0) { + output.writeInt32(2, pageSize_); + } + if (!getMarkerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, marker_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (request_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRequest()); + } + if (pageSize_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(2, pageSize_); + } + if (!getMarkerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, marker_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.ListFileRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.ListFileRequest other = (spec.proto.runtime.v1.RuntimeProto.ListFileRequest) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest() + .equals(other.getRequest())) return false; + } + if (getPageSize() + != other.getPageSize()) return false; + if (!getMarker() + .equals(other.getMarker())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (37 * hash) + PAGE_SIZE_FIELD_NUMBER; + hash = (53 * hash) + getPageSize(); + hash = (37 * hash) + MARKER_FIELD_NUMBER; + hash = (53 * hash) + getMarker().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest 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 spec.proto.runtime.v1.RuntimeProto.ListFileRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest 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 spec.proto.runtime.v1.RuntimeProto.ListFileRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest 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(spec.proto.runtime.v1.RuntimeProto.ListFileRequest 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 spec.proto.runtime.v1.ListFileRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.ListFileRequest) + spec.proto.runtime.v1.RuntimeProto.ListFileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ListFileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ListFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.ListFileRequest.class, spec.proto.runtime.v1.RuntimeProto.ListFileRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.ListFileRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + pageSize_ = 0; + + marker_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ListFileRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ListFileRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.ListFileRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ListFileRequest build() { + spec.proto.runtime.v1.RuntimeProto.ListFileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ListFileRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.ListFileRequest result = new spec.proto.runtime.v1.RuntimeProto.ListFileRequest(this); + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + result.pageSize_ = pageSize_; + result.marker_ = marker_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.ListFileRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.ListFileRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.ListFileRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.ListFileRequest.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + if (other.getPageSize() != 0) { + setPageSize(other.getPageSize()); + } + if (!other.getMarker().isEmpty()) { + marker_ = other.marker_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.ListFileRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.ListFileRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.FileRequest request_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileRequest, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder, spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder> requestBuilder_; + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return The request. + */ + public spec.proto.runtime.v1.RuntimeProto.FileRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null ? spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance() : request_; + } else { + return requestBuilder_.getMessage(); + } + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder setRequest(spec.proto.runtime.v1.RuntimeProto.FileRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder setRequest( + spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder mergeRequest(spec.proto.runtime.v1.RuntimeProto.FileRequest value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = + spec.proto.runtime.v1.RuntimeProto.FileRequest.newBuilder(request_).mergeFrom(value).buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null ? + spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance() : request_; + } + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileRequest, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder, spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileRequest, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder, spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder>( + getRequest(), + getParentForChildren(), + isClean()); + request_ = null; + } + return requestBuilder_; + } + + private int pageSize_ ; + /** + * int32 page_size = 2; + * @return The pageSize. + */ + @java.lang.Override + public int getPageSize() { + return pageSize_; + } + /** + * int32 page_size = 2; + * @param value The pageSize to set. + * @return This builder for chaining. + */ + public Builder setPageSize(int value) { + + pageSize_ = value; + onChanged(); + return this; + } + /** + * int32 page_size = 2; + * @return This builder for chaining. + */ + public Builder clearPageSize() { + + pageSize_ = 0; + onChanged(); + return this; + } + + private java.lang.Object marker_ = ""; + /** + * string marker = 3; + * @return The marker. + */ + public java.lang.String getMarker() { + java.lang.Object ref = marker_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + marker_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string marker = 3; + * @return The bytes for marker. + */ + public com.google.protobuf.ByteString + getMarkerBytes() { + java.lang.Object ref = marker_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + marker_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string marker = 3; + * @param value The marker to set. + * @return This builder for chaining. + */ + public Builder setMarker( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + marker_ = value; + onChanged(); + return this; + } + /** + * string marker = 3; + * @return This builder for chaining. + */ + public Builder clearMarker() { + + marker_ = getDefaultInstance().getMarker(); + onChanged(); + return this; + } + /** + * string marker = 3; + * @param value The bytes for marker to set. + * @return This builder for chaining. + */ + public Builder setMarkerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + marker_ = value; + 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:spec.proto.runtime.v1.ListFileRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.ListFileRequest) + private static final spec.proto.runtime.v1.RuntimeProto.ListFileRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.ListFileRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.ListFileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFileRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ListFileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface FileInfoOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.FileInfo) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The name of file
+     * 
+ * + * string file_name = 1; + * @return The fileName. + */ + java.lang.String getFileName(); + /** + *
+     * The name of file
+     * 
+ * + * string file_name = 1; + * @return The bytes for fileName. + */ + com.google.protobuf.ByteString + getFileNameBytes(); + + /** + *
+     * The size of file
+     * 
+ * + * int64 size = 2; + * @return The size. + */ + long getSize(); + + /** + *
+     * The modified time of file
+     * 
+ * + * string last_modified = 3; + * @return The lastModified. + */ + java.lang.String getLastModified(); + /** + *
+     * The modified time of file
+     * 
+ * + * string last_modified = 3; + * @return The bytes for lastModified. + */ + com.google.protobuf.ByteString + getLastModifiedBytes(); + + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + int getMetadataCount(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.FileInfo} + */ + public static final class FileInfo extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.FileInfo) + FileInfoOrBuilder { + private static final long serialVersionUID = 0L; + // Use FileInfo.newBuilder() to construct. + private FileInfo(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private FileInfo() { + fileName_ = ""; + lastModified_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new FileInfo(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private FileInfo( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + fileName_ = s; + break; + } + case 16: { + + size_ = input.readInt64(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + lastModified_ = s; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.FileInfo.class, spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder.class); + } + + public static final int FILE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object fileName_; + /** + *
+     * The name of file
+     * 
+ * + * string file_name = 1; + * @return The fileName. + */ + @java.lang.Override + public java.lang.String getFileName() { + java.lang.Object ref = fileName_; + 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(); + fileName_ = s; + return s; + } + } + /** + *
+     * The name of file
+     * 
+ * + * string file_name = 1; + * @return The bytes for fileName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getFileNameBytes() { + java.lang.Object ref = fileName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int SIZE_FIELD_NUMBER = 2; + private long size_; + /** + *
+     * The size of file
+     * 
+ * + * int64 size = 2; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + + public static final int LAST_MODIFIED_FIELD_NUMBER = 3; + private volatile java.lang.Object lastModified_; + /** + *
+     * The modified time of file
+     * 
+ * + * string last_modified = 3; + * @return The lastModified. + */ + @java.lang.Override + public java.lang.String getLastModified() { + java.lang.Object ref = lastModified_; + 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(); + lastModified_ = s; + return s; + } + } + /** + *
+     * The modified time of file
+     * 
+ * + * string last_modified = 3; + * @return The bytes for lastModified. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLastModifiedBytes() { + java.lang.Object ref = lastModified_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lastModified_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 4; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileInfo_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata for user extension.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getFileNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, fileName_); + } + if (size_ != 0L) { + output.writeInt64(2, size_); + } + if (!getLastModifiedBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, lastModified_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 4); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getFileNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, fileName_); + } + if (size_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, size_); + } + if (!getLastModifiedBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, lastModified_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.FileInfo)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.FileInfo other = (spec.proto.runtime.v1.RuntimeProto.FileInfo) obj; + + if (!getFileName() + .equals(other.getFileName())) return false; + if (getSize() + != other.getSize()) return false; + if (!getLastModified() + .equals(other.getLastModified())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + FILE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getFileName().hashCode(); + hash = (37 * hash) + SIZE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getSize()); + hash = (37 * hash) + LAST_MODIFIED_FIELD_NUMBER; + hash = (53 * hash) + getLastModified().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.FileInfo parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileInfo parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileInfo parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileInfo parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileInfo parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.FileInfo parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.FileInfo parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileInfo 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 spec.proto.runtime.v1.RuntimeProto.FileInfo parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileInfo 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 spec.proto.runtime.v1.RuntimeProto.FileInfo parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.FileInfo 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(spec.proto.runtime.v1.RuntimeProto.FileInfo 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 spec.proto.runtime.v1.FileInfo} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.FileInfo) + spec.proto.runtime.v1.RuntimeProto.FileInfoOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileInfo_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileInfo_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.FileInfo.class, spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.FileInfo.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + fileName_ = ""; + + size_ = 0L; + + lastModified_ = ""; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_FileInfo_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileInfo getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.FileInfo.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileInfo build() { + spec.proto.runtime.v1.RuntimeProto.FileInfo result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileInfo buildPartial() { + spec.proto.runtime.v1.RuntimeProto.FileInfo result = new spec.proto.runtime.v1.RuntimeProto.FileInfo(this); + int from_bitField0_ = bitField0_; + result.fileName_ = fileName_; + result.size_ = size_; + result.lastModified_ = lastModified_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.FileInfo) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.FileInfo)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.FileInfo other) { + if (other == spec.proto.runtime.v1.RuntimeProto.FileInfo.getDefaultInstance()) return this; + if (!other.getFileName().isEmpty()) { + fileName_ = other.fileName_; + onChanged(); + } + if (other.getSize() != 0L) { + setSize(other.getSize()); + } + if (!other.getLastModified().isEmpty()) { + lastModified_ = other.lastModified_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.FileInfo parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.FileInfo) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object fileName_ = ""; + /** + *
+       * The name of file
+       * 
+ * + * string file_name = 1; + * @return The fileName. + */ + public java.lang.String getFileName() { + java.lang.Object ref = fileName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + fileName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of file
+       * 
+ * + * string file_name = 1; + * @return The bytes for fileName. + */ + public com.google.protobuf.ByteString + getFileNameBytes() { + java.lang.Object ref = fileName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + fileName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of file
+       * 
+ * + * string file_name = 1; + * @param value The fileName to set. + * @return This builder for chaining. + */ + public Builder setFileName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + fileName_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of file
+       * 
+ * + * string file_name = 1; + * @return This builder for chaining. + */ + public Builder clearFileName() { + + fileName_ = getDefaultInstance().getFileName(); + onChanged(); + return this; + } + /** + *
+       * The name of file
+       * 
+ * + * string file_name = 1; + * @param value The bytes for fileName to set. + * @return This builder for chaining. + */ + public Builder setFileNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + fileName_ = value; + onChanged(); + return this; + } + + private long size_ ; + /** + *
+       * The size of file
+       * 
+ * + * int64 size = 2; + * @return The size. + */ + @java.lang.Override + public long getSize() { + return size_; + } + /** + *
+       * The size of file
+       * 
+ * + * int64 size = 2; + * @param value The size to set. + * @return This builder for chaining. + */ + public Builder setSize(long value) { + + size_ = value; + onChanged(); + return this; + } + /** + *
+       * The size of file
+       * 
+ * + * int64 size = 2; + * @return This builder for chaining. + */ + public Builder clearSize() { + + size_ = 0L; + onChanged(); + return this; + } + + private java.lang.Object lastModified_ = ""; + /** + *
+       * The modified time of file
+       * 
+ * + * string last_modified = 3; + * @return The lastModified. + */ + public java.lang.String getLastModified() { + java.lang.Object ref = lastModified_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lastModified_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The modified time of file
+       * 
+ * + * string last_modified = 3; + * @return The bytes for lastModified. + */ + public com.google.protobuf.ByteString + getLastModifiedBytes() { + java.lang.Object ref = lastModified_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lastModified_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The modified time of file
+       * 
+ * + * string last_modified = 3; + * @param value The lastModified to set. + * @return This builder for chaining. + */ + public Builder setLastModified( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lastModified_ = value; + onChanged(); + return this; + } + /** + *
+       * The modified time of file
+       * 
+ * + * string last_modified = 3; + * @return This builder for chaining. + */ + public Builder clearLastModified() { + + lastModified_ = getDefaultInstance().getLastModified(); + onChanged(); + return this; + } + /** + *
+       * The modified time of file
+       * 
+ * + * string last_modified = 3; + * @param value The bytes for lastModified to set. + * @return This builder for chaining. + */ + public Builder setLastModifiedBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lastModified_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata for user extension.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.FileInfo) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.FileInfo) + private static final spec.proto.runtime.v1.RuntimeProto.FileInfo DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.FileInfo(); + } + + public static spec.proto.runtime.v1.RuntimeProto.FileInfo getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public FileInfo parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new FileInfo(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileInfo getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ListFileRespOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.ListFileResp) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + java.util.List + getFilesList(); + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + spec.proto.runtime.v1.RuntimeProto.FileInfo getFiles(int index); + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + int getFilesCount(); + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + java.util.List + getFilesOrBuilderList(); + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + spec.proto.runtime.v1.RuntimeProto.FileInfoOrBuilder getFilesOrBuilder( + int index); + + /** + * string marker = 2; + * @return The marker. + */ + java.lang.String getMarker(); + /** + * string marker = 2; + * @return The bytes for marker. + */ + com.google.protobuf.ByteString + getMarkerBytes(); + + /** + * bool is_truncated = 3; + * @return The isTruncated. + */ + boolean getIsTruncated(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.ListFileResp} + */ + public static final class ListFileResp extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.ListFileResp) + ListFileRespOrBuilder { + private static final long serialVersionUID = 0L; + // Use ListFileResp.newBuilder() to construct. + private ListFileResp(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ListFileResp() { + files_ = java.util.Collections.emptyList(); + marker_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ListFileResp(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ListFileResp( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + files_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + files_.add( + input.readMessage(spec.proto.runtime.v1.RuntimeProto.FileInfo.parser(), extensionRegistry)); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + marker_ = s; + break; + } + case 24: { + + isTruncated_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + files_ = java.util.Collections.unmodifiableList(files_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ListFileResp_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ListFileResp_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.ListFileResp.class, spec.proto.runtime.v1.RuntimeProto.ListFileResp.Builder.class); + } + + public static final int FILES_FIELD_NUMBER = 1; + private java.util.List files_; + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + @java.lang.Override + public java.util.List getFilesList() { + return files_; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + @java.lang.Override + public java.util.List + getFilesOrBuilderList() { + return files_; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + @java.lang.Override + public int getFilesCount() { + return files_.size(); + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileInfo getFiles(int index) { + return files_.get(index); + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileInfoOrBuilder getFilesOrBuilder( + int index) { + return files_.get(index); + } + + public static final int MARKER_FIELD_NUMBER = 2; + private volatile java.lang.Object marker_; + /** + * string marker = 2; + * @return The marker. + */ + @java.lang.Override + public java.lang.String getMarker() { + java.lang.Object ref = marker_; + 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(); + marker_ = s; + return s; + } + } + /** + * string marker = 2; + * @return The bytes for marker. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMarkerBytes() { + java.lang.Object ref = marker_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + marker_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int IS_TRUNCATED_FIELD_NUMBER = 3; + private boolean isTruncated_; + /** + * bool is_truncated = 3; + * @return The isTruncated. + */ + @java.lang.Override + public boolean getIsTruncated() { + return isTruncated_; + } + + 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 < files_.size(); i++) { + output.writeMessage(1, files_.get(i)); + } + if (!getMarkerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, marker_); + } + if (isTruncated_ != false) { + output.writeBool(3, isTruncated_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < files_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, files_.get(i)); + } + if (!getMarkerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, marker_); + } + if (isTruncated_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(3, isTruncated_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.ListFileResp)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.ListFileResp other = (spec.proto.runtime.v1.RuntimeProto.ListFileResp) obj; + + if (!getFilesList() + .equals(other.getFilesList())) return false; + if (!getMarker() + .equals(other.getMarker())) return false; + if (getIsTruncated() + != other.getIsTruncated()) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getFilesCount() > 0) { + hash = (37 * hash) + FILES_FIELD_NUMBER; + hash = (53 * hash) + getFilesList().hashCode(); + } + hash = (37 * hash) + MARKER_FIELD_NUMBER; + hash = (53 * hash) + getMarker().hashCode(); + hash = (37 * hash) + IS_TRUNCATED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getIsTruncated()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp 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 spec.proto.runtime.v1.RuntimeProto.ListFileResp parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp 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 spec.proto.runtime.v1.RuntimeProto.ListFileResp parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp 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(spec.proto.runtime.v1.RuntimeProto.ListFileResp 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 spec.proto.runtime.v1.ListFileResp} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.ListFileResp) + spec.proto.runtime.v1.RuntimeProto.ListFileRespOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ListFileResp_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ListFileResp_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.ListFileResp.class, spec.proto.runtime.v1.RuntimeProto.ListFileResp.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.ListFileResp.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getFilesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (filesBuilder_ == null) { + files_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + filesBuilder_.clear(); + } + marker_ = ""; + + isTruncated_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ListFileResp_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ListFileResp getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.ListFileResp.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ListFileResp build() { + spec.proto.runtime.v1.RuntimeProto.ListFileResp result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ListFileResp buildPartial() { + spec.proto.runtime.v1.RuntimeProto.ListFileResp result = new spec.proto.runtime.v1.RuntimeProto.ListFileResp(this); + int from_bitField0_ = bitField0_; + if (filesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + files_ = java.util.Collections.unmodifiableList(files_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.files_ = files_; + } else { + result.files_ = filesBuilder_.build(); + } + result.marker_ = marker_; + result.isTruncated_ = isTruncated_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.ListFileResp) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.ListFileResp)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.ListFileResp other) { + if (other == spec.proto.runtime.v1.RuntimeProto.ListFileResp.getDefaultInstance()) return this; + if (filesBuilder_ == null) { + if (!other.files_.isEmpty()) { + if (files_.isEmpty()) { + files_ = other.files_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureFilesIsMutable(); + files_.addAll(other.files_); + } + onChanged(); + } + } else { + if (!other.files_.isEmpty()) { + if (filesBuilder_.isEmpty()) { + filesBuilder_.dispose(); + filesBuilder_ = null; + files_ = other.files_; + bitField0_ = (bitField0_ & ~0x00000001); + filesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getFilesFieldBuilder() : null; + } else { + filesBuilder_.addAllMessages(other.files_); + } + } + } + if (!other.getMarker().isEmpty()) { + marker_ = other.marker_; + onChanged(); + } + if (other.getIsTruncated() != false) { + setIsTruncated(other.getIsTruncated()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.ListFileResp parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.ListFileResp) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List files_ = + java.util.Collections.emptyList(); + private void ensureFilesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + files_ = new java.util.ArrayList(files_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileInfo, spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder, spec.proto.runtime.v1.RuntimeProto.FileInfoOrBuilder> filesBuilder_; + + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public java.util.List getFilesList() { + if (filesBuilder_ == null) { + return java.util.Collections.unmodifiableList(files_); + } else { + return filesBuilder_.getMessageList(); + } + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public int getFilesCount() { + if (filesBuilder_ == null) { + return files_.size(); + } else { + return filesBuilder_.getCount(); + } + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileInfo getFiles(int index) { + if (filesBuilder_ == null) { + return files_.get(index); + } else { + return filesBuilder_.getMessage(index); + } + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public Builder setFiles( + int index, spec.proto.runtime.v1.RuntimeProto.FileInfo value) { + if (filesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFilesIsMutable(); + files_.set(index, value); + onChanged(); + } else { + filesBuilder_.setMessage(index, value); + } + return this; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public Builder setFiles( + int index, spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder builderForValue) { + if (filesBuilder_ == null) { + ensureFilesIsMutable(); + files_.set(index, builderForValue.build()); + onChanged(); + } else { + filesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public Builder addFiles(spec.proto.runtime.v1.RuntimeProto.FileInfo value) { + if (filesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFilesIsMutable(); + files_.add(value); + onChanged(); + } else { + filesBuilder_.addMessage(value); + } + return this; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public Builder addFiles( + int index, spec.proto.runtime.v1.RuntimeProto.FileInfo value) { + if (filesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureFilesIsMutable(); + files_.add(index, value); + onChanged(); + } else { + filesBuilder_.addMessage(index, value); + } + return this; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public Builder addFiles( + spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder builderForValue) { + if (filesBuilder_ == null) { + ensureFilesIsMutable(); + files_.add(builderForValue.build()); + onChanged(); + } else { + filesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public Builder addFiles( + int index, spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder builderForValue) { + if (filesBuilder_ == null) { + ensureFilesIsMutable(); + files_.add(index, builderForValue.build()); + onChanged(); + } else { + filesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public Builder addAllFiles( + java.lang.Iterable values) { + if (filesBuilder_ == null) { + ensureFilesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, files_); + onChanged(); + } else { + filesBuilder_.addAllMessages(values); + } + return this; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public Builder clearFiles() { + if (filesBuilder_ == null) { + files_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + filesBuilder_.clear(); + } + return this; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public Builder removeFiles(int index) { + if (filesBuilder_ == null) { + ensureFilesIsMutable(); + files_.remove(index); + onChanged(); + } else { + filesBuilder_.remove(index); + } + return this; + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder getFilesBuilder( + int index) { + return getFilesFieldBuilder().getBuilder(index); + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileInfoOrBuilder getFilesOrBuilder( + int index) { + if (filesBuilder_ == null) { + return files_.get(index); } else { + return filesBuilder_.getMessageOrBuilder(index); + } + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public java.util.List + getFilesOrBuilderList() { + if (filesBuilder_ != null) { + return filesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(files_); + } + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder addFilesBuilder() { + return getFilesFieldBuilder().addBuilder( + spec.proto.runtime.v1.RuntimeProto.FileInfo.getDefaultInstance()); + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder addFilesBuilder( + int index) { + return getFilesFieldBuilder().addBuilder( + index, spec.proto.runtime.v1.RuntimeProto.FileInfo.getDefaultInstance()); + } + /** + * repeated .spec.proto.runtime.v1.FileInfo files = 1; + */ + public java.util.List + getFilesBuilderList() { + return getFilesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileInfo, spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder, spec.proto.runtime.v1.RuntimeProto.FileInfoOrBuilder> + getFilesFieldBuilder() { + if (filesBuilder_ == null) { + filesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileInfo, spec.proto.runtime.v1.RuntimeProto.FileInfo.Builder, spec.proto.runtime.v1.RuntimeProto.FileInfoOrBuilder>( + files_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + files_ = null; + } + return filesBuilder_; + } + + private java.lang.Object marker_ = ""; + /** + * string marker = 2; + * @return The marker. + */ + public java.lang.String getMarker() { + java.lang.Object ref = marker_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + marker_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string marker = 2; + * @return The bytes for marker. + */ + public com.google.protobuf.ByteString + getMarkerBytes() { + java.lang.Object ref = marker_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + marker_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string marker = 2; + * @param value The marker to set. + * @return This builder for chaining. + */ + public Builder setMarker( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + marker_ = value; + onChanged(); + return this; + } + /** + * string marker = 2; + * @return This builder for chaining. + */ + public Builder clearMarker() { + + marker_ = getDefaultInstance().getMarker(); + onChanged(); + return this; + } + /** + * string marker = 2; + * @param value The bytes for marker to set. + * @return This builder for chaining. + */ + public Builder setMarkerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + marker_ = value; + onChanged(); + return this; + } + + private boolean isTruncated_ ; + /** + * bool is_truncated = 3; + * @return The isTruncated. + */ + @java.lang.Override + public boolean getIsTruncated() { + return isTruncated_; + } + /** + * bool is_truncated = 3; + * @param value The isTruncated to set. + * @return This builder for chaining. + */ + public Builder setIsTruncated(boolean value) { + + isTruncated_ = value; + onChanged(); + return this; + } + /** + * bool is_truncated = 3; + * @return This builder for chaining. + */ + public Builder clearIsTruncated() { + + isTruncated_ = false; + 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:spec.proto.runtime.v1.ListFileResp) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.ListFileResp) + private static final spec.proto.runtime.v1.RuntimeProto.ListFileResp DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.ListFileResp(); + } + + public static spec.proto.runtime.v1.RuntimeProto.ListFileResp getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ListFileResp parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ListFileResp(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ListFileResp getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DelFileRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.DelFileRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return Whether the request field is set. + */ + boolean hasRequest(); + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return The request. + */ + spec.proto.runtime.v1.RuntimeProto.FileRequest getRequest(); + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder getRequestOrBuilder(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.DelFileRequest} + */ + public static final class DelFileRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.DelFileRequest) + DelFileRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DelFileRequest.newBuilder() to construct. + private DelFileRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DelFileRequest() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DelFileRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DelFileRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.FileRequest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DelFileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DelFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.DelFileRequest.class, spec.proto.runtime.v1.RuntimeProto.DelFileRequest.Builder.class); + } + + public static final int REQUEST_FIELD_NUMBER = 1; + private spec.proto.runtime.v1.RuntimeProto.FileRequest request_; + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return The request. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileRequest getRequest() { + return request_ == null ? spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance() : request_; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + 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 (request_ != null) { + output.writeMessage(1, getRequest()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (request_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getRequest()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.DelFileRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.DelFileRequest other = (spec.proto.runtime.v1.RuntimeProto.DelFileRequest) obj; + + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest() + .equals(other.getRequest())) return false; + } + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest 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 spec.proto.runtime.v1.RuntimeProto.DelFileRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest 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 spec.proto.runtime.v1.RuntimeProto.DelFileRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest 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(spec.proto.runtime.v1.RuntimeProto.DelFileRequest 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 spec.proto.runtime.v1.DelFileRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.DelFileRequest) + spec.proto.runtime.v1.RuntimeProto.DelFileRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DelFileRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DelFileRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.DelFileRequest.class, spec.proto.runtime.v1.RuntimeProto.DelFileRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.DelFileRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DelFileRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DelFileRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.DelFileRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DelFileRequest build() { + spec.proto.runtime.v1.RuntimeProto.DelFileRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DelFileRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.DelFileRequest result = new spec.proto.runtime.v1.RuntimeProto.DelFileRequest(this); + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.DelFileRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.DelFileRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.DelFileRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.DelFileRequest.getDefaultInstance()) return this; + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.DelFileRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.DelFileRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.FileRequest request_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileRequest, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder, spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder> requestBuilder_; + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + * @return The request. + */ + public spec.proto.runtime.v1.RuntimeProto.FileRequest getRequest() { + if (requestBuilder_ == null) { + return request_ == null ? spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance() : request_; + } else { + return requestBuilder_.getMessage(); + } + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder setRequest(spec.proto.runtime.v1.RuntimeProto.FileRequest value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder setRequest( + spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder mergeRequest(spec.proto.runtime.v1.RuntimeProto.FileRequest value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = + spec.proto.runtime.v1.RuntimeProto.FileRequest.newBuilder(request_).mergeFrom(value).buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null ? + spec.proto.runtime.v1.RuntimeProto.FileRequest.getDefaultInstance() : request_; + } + } + /** + * .spec.proto.runtime.v1.FileRequest request = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileRequest, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder, spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.FileRequest, spec.proto.runtime.v1.RuntimeProto.FileRequest.Builder, spec.proto.runtime.v1.RuntimeProto.FileRequestOrBuilder>( + getRequest(), + getParentForChildren(), + isClean()); + request_ = null; + } + return requestBuilder_; + } + @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:spec.proto.runtime.v1.DelFileRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.DelFileRequest) + private static final spec.proto.runtime.v1.RuntimeProto.DelFileRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.DelFileRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.DelFileRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DelFileRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DelFileRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DelFileRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetNextIdRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetNextIdRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. Name of sequencer storage
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * Required. Name of sequencer storage
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * Required. key is the identifier of a sequencer namespace,e.g. "order_table".
+     * 
+ * + * string key = 2; + * @return The key. + */ + java.lang.String getKey(); + /** + *
+     * Required. key is the identifier of a sequencer namespace,e.g. "order_table".
+     * 
+ * + * string key = 2; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + *
+     * (optional) SequencerOptions configures requirements for auto-increment guarantee
+     * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + * @return Whether the options field is set. + */ + boolean hasOptions(); + /** + *
+     * (optional) SequencerOptions configures requirements for auto-increment guarantee
+     * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + * @return The options. + */ + spec.proto.runtime.v1.RuntimeProto.SequencerOptions getOptions(); + /** + *
+     * (optional) SequencerOptions configures requirements for auto-increment guarantee
+     * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + */ + spec.proto.runtime.v1.RuntimeProto.SequencerOptionsOrBuilder getOptionsOrBuilder(); + + /** + *
+     * (optional) The metadata which will be sent to the component.
+     * 
+ * + * map<string, string> metadata = 4; + */ + int getMetadataCount(); + /** + *
+     * (optional) The metadata which will be sent to the component.
+     * 
+ * + * map<string, string> metadata = 4; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * (optional) The metadata which will be sent to the component.
+     * 
+ * + * map<string, string> metadata = 4; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * (optional) The metadata which will be sent to the component.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * (optional) The metadata which will be sent to the component.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.GetNextIdRequest} + */ + public static final class GetNextIdRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetNextIdRequest) + GetNextIdRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetNextIdRequest.newBuilder() to construct. + private GetNextIdRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetNextIdRequest() { + storeName_ = ""; + key_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetNextIdRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetNextIdRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 26: { + spec.proto.runtime.v1.RuntimeProto.SequencerOptions.Builder subBuilder = null; + if (options_ != null) { + subBuilder = options_.toBuilder(); + } + options_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.SequencerOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(options_); + options_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest.class, spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * Required. Name of sequencer storage
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * Required. Name of sequencer storage
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object key_; + /** + *
+     * Required. key is the identifier of a sequencer namespace,e.g. "order_table".
+     * 
+ * + * string key = 2; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + *
+     * Required. key is the identifier of a sequencer namespace,e.g. "order_table".
+     * 
+ * + * string key = 2; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPTIONS_FIELD_NUMBER = 3; + private spec.proto.runtime.v1.RuntimeProto.SequencerOptions options_; + /** + *
+     * (optional) SequencerOptions configures requirements for auto-increment guarantee
+     * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + * @return Whether the options field is set. + */ + @java.lang.Override + public boolean hasOptions() { + return options_ != null; + } + /** + *
+     * (optional) SequencerOptions configures requirements for auto-increment guarantee
+     * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + * @return The options. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SequencerOptions getOptions() { + return options_ == null ? spec.proto.runtime.v1.RuntimeProto.SequencerOptions.getDefaultInstance() : options_; + } + /** + *
+     * (optional) SequencerOptions configures requirements for auto-increment guarantee
+     * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SequencerOptionsOrBuilder getOptionsOrBuilder() { + return getOptions(); + } + + public static final int METADATA_FIELD_NUMBER = 4; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * (optional) The metadata which will be sent to the component.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * (optional) The metadata which will be sent to the component.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * (optional) The metadata which will be sent to the component.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * (optional) The metadata which will be sent to the component.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + if (options_ != null) { + output.writeMessage(3, getOptions()); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 4); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + if (options_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getOptions()); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest other = (spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getKey() + .equals(other.getKey())) return false; + if (hasOptions() != other.hasOptions()) return false; + if (hasOptions()) { + if (!getOptions() + .equals(other.getOptions())) return false; + } + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (hasOptions()) { + hash = (37 * hash) + OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getOptions().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest 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 spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest 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 spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest 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(spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest 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 spec.proto.runtime.v1.GetNextIdRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetNextIdRequest) + spec.proto.runtime.v1.RuntimeProto.GetNextIdRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest.class, spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + key_ = ""; + + if (optionsBuilder_ == null) { + options_ = null; + } else { + options_ = null; + optionsBuilder_ = null; + } + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest build() { + spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest result = new spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.key_ = key_; + if (optionsBuilder_ == null) { + result.options_ = options_; + } else { + result.options_ = optionsBuilder_.build(); + } + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.hasOptions()) { + mergeOptions(other.getOptions()); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * Required. Name of sequencer storage
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. Name of sequencer storage
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. Name of sequencer storage
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. Name of sequencer storage
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * Required. Name of sequencer storage
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + *
+       * Required. key is the identifier of a sequencer namespace,e.g. "order_table".
+       * 
+ * + * string key = 2; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. key is the identifier of a sequencer namespace,e.g. "order_table".
+       * 
+ * + * string key = 2; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. key is the identifier of a sequencer namespace,e.g. "order_table".
+       * 
+ * + * string key = 2; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. key is the identifier of a sequencer namespace,e.g. "order_table".
+       * 
+ * + * string key = 2; + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + *
+       * Required. key is the identifier of a sequencer namespace,e.g. "order_table".
+       * 
+ * + * string key = 2; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.SequencerOptions options_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.SequencerOptions, spec.proto.runtime.v1.RuntimeProto.SequencerOptions.Builder, spec.proto.runtime.v1.RuntimeProto.SequencerOptionsOrBuilder> optionsBuilder_; + /** + *
+       * (optional) SequencerOptions configures requirements for auto-increment guarantee
+       * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + * @return Whether the options field is set. + */ + public boolean hasOptions() { + return optionsBuilder_ != null || options_ != null; + } + /** + *
+       * (optional) SequencerOptions configures requirements for auto-increment guarantee
+       * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + * @return The options. + */ + public spec.proto.runtime.v1.RuntimeProto.SequencerOptions getOptions() { + if (optionsBuilder_ == null) { + return options_ == null ? spec.proto.runtime.v1.RuntimeProto.SequencerOptions.getDefaultInstance() : options_; + } else { + return optionsBuilder_.getMessage(); + } + } + /** + *
+       * (optional) SequencerOptions configures requirements for auto-increment guarantee
+       * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + */ + public Builder setOptions(spec.proto.runtime.v1.RuntimeProto.SequencerOptions value) { + if (optionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + options_ = value; + onChanged(); + } else { + optionsBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * (optional) SequencerOptions configures requirements for auto-increment guarantee
+       * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + */ + public Builder setOptions( + spec.proto.runtime.v1.RuntimeProto.SequencerOptions.Builder builderForValue) { + if (optionsBuilder_ == null) { + options_ = builderForValue.build(); + onChanged(); + } else { + optionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * (optional) SequencerOptions configures requirements for auto-increment guarantee
+       * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + */ + public Builder mergeOptions(spec.proto.runtime.v1.RuntimeProto.SequencerOptions value) { + if (optionsBuilder_ == null) { + if (options_ != null) { + options_ = + spec.proto.runtime.v1.RuntimeProto.SequencerOptions.newBuilder(options_).mergeFrom(value).buildPartial(); + } else { + options_ = value; + } + onChanged(); + } else { + optionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * (optional) SequencerOptions configures requirements for auto-increment guarantee
+       * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + */ + public Builder clearOptions() { + if (optionsBuilder_ == null) { + options_ = null; + onChanged(); + } else { + options_ = null; + optionsBuilder_ = null; + } + + return this; + } + /** + *
+       * (optional) SequencerOptions configures requirements for auto-increment guarantee
+       * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.SequencerOptions.Builder getOptionsBuilder() { + + onChanged(); + return getOptionsFieldBuilder().getBuilder(); + } + /** + *
+       * (optional) SequencerOptions configures requirements for auto-increment guarantee
+       * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.SequencerOptionsOrBuilder getOptionsOrBuilder() { + if (optionsBuilder_ != null) { + return optionsBuilder_.getMessageOrBuilder(); + } else { + return options_ == null ? + spec.proto.runtime.v1.RuntimeProto.SequencerOptions.getDefaultInstance() : options_; + } + } + /** + *
+       * (optional) SequencerOptions configures requirements for auto-increment guarantee
+       * 
+ * + * .spec.proto.runtime.v1.SequencerOptions options = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.SequencerOptions, spec.proto.runtime.v1.RuntimeProto.SequencerOptions.Builder, spec.proto.runtime.v1.RuntimeProto.SequencerOptionsOrBuilder> + getOptionsFieldBuilder() { + if (optionsBuilder_ == null) { + optionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.SequencerOptions, spec.proto.runtime.v1.RuntimeProto.SequencerOptions.Builder, spec.proto.runtime.v1.RuntimeProto.SequencerOptionsOrBuilder>( + getOptions(), + getParentForChildren(), + isClean()); + options_ = null; + } + return optionsBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * (optional) The metadata which will be sent to the component.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * (optional) The metadata which will be sent to the component.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * (optional) The metadata which will be sent to the component.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * (optional) The metadata which will be sent to the component.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * (optional) The metadata which will be sent to the component.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * (optional) The metadata which will be sent to the component.
+       * 
+ * + * map<string, string> metadata = 4; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * (optional) The metadata which will be sent to the component.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.GetNextIdRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetNextIdRequest) + private static final spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetNextIdRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetNextIdRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetNextIdRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SequencerOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.SequencerOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * .spec.proto.runtime.v1.SequencerOptions.AutoIncrement increment = 1; + * @return The enum numeric value on the wire for increment. + */ + int getIncrementValue(); + /** + * .spec.proto.runtime.v1.SequencerOptions.AutoIncrement increment = 1; + * @return The increment. + */ + spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement getIncrement(); + } + /** + *
+   * SequencerOptions configures requirements for auto-increment guarantee
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.SequencerOptions} + */ + public static final class SequencerOptions extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.SequencerOptions) + SequencerOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use SequencerOptions.newBuilder() to construct. + private SequencerOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SequencerOptions() { + increment_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SequencerOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SequencerOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + increment_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SequencerOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SequencerOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SequencerOptions.class, spec.proto.runtime.v1.RuntimeProto.SequencerOptions.Builder.class); + } + + /** + *
+     * requirements for auto-increment guarantee
+     * 
+ * + * Protobuf enum {@code spec.proto.runtime.v1.SequencerOptions.AutoIncrement} + */ + public enum AutoIncrement + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+       * (default) WEAK means a "best effort" incrementing service.But there is no strict guarantee of global monotonically increasing.
+       *The next id is "probably" greater than current id.
+       * 
+ * + * WEAK = 0; + */ + WEAK(0), + /** + *
+       * STRONG means a strict guarantee of global monotonically increasing.
+       *The next id "must" be greater than current id.
+       * 
+ * + * STRONG = 1; + */ + STRONG(1), + UNRECOGNIZED(-1), + ; + + /** + *
+       * (default) WEAK means a "best effort" incrementing service.But there is no strict guarantee of global monotonically increasing.
+       *The next id is "probably" greater than current id.
+       * 
+ * + * WEAK = 0; + */ + public static final int WEAK_VALUE = 0; + /** + *
+       * STRONG means a strict guarantee of global monotonically increasing.
+       *The next id "must" be greater than current id.
+       * 
+ * + * STRONG = 1; + */ + public static final int STRONG_VALUE = 1; + + + 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 AutoIncrement 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 AutoIncrement forNumber(int value) { + switch (value) { + case 0: return WEAK; + case 1: return STRONG; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + AutoIncrement> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public AutoIncrement findValueByNumber(int number) { + return AutoIncrement.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 spec.proto.runtime.v1.RuntimeProto.SequencerOptions.getDescriptor().getEnumTypes().get(0); + } + + private static final AutoIncrement[] VALUES = values(); + + public static AutoIncrement 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 AutoIncrement(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:spec.proto.runtime.v1.SequencerOptions.AutoIncrement) + } + + public static final int INCREMENT_FIELD_NUMBER = 1; + private int increment_; + /** + * .spec.proto.runtime.v1.SequencerOptions.AutoIncrement increment = 1; + * @return The enum numeric value on the wire for increment. + */ + @java.lang.Override public int getIncrementValue() { + return increment_; + } + /** + * .spec.proto.runtime.v1.SequencerOptions.AutoIncrement increment = 1; + * @return The increment. + */ + @java.lang.Override public spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement getIncrement() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement result = spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement.valueOf(increment_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement.UNRECOGNIZED : result; + } + + 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 (increment_ != spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement.WEAK.getNumber()) { + output.writeEnum(1, increment_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (increment_ != spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement.WEAK.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, increment_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.SequencerOptions)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.SequencerOptions other = (spec.proto.runtime.v1.RuntimeProto.SequencerOptions) obj; + + if (increment_ != other.increment_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + INCREMENT_FIELD_NUMBER; + hash = (53 * hash) + increment_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions 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 spec.proto.runtime.v1.RuntimeProto.SequencerOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions 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 spec.proto.runtime.v1.RuntimeProto.SequencerOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions 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(spec.proto.runtime.v1.RuntimeProto.SequencerOptions 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; + } + /** + *
+     * SequencerOptions configures requirements for auto-increment guarantee
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.SequencerOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.SequencerOptions) + spec.proto.runtime.v1.RuntimeProto.SequencerOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SequencerOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SequencerOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SequencerOptions.class, spec.proto.runtime.v1.RuntimeProto.SequencerOptions.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.SequencerOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + increment_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SequencerOptions_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SequencerOptions getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.SequencerOptions.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SequencerOptions build() { + spec.proto.runtime.v1.RuntimeProto.SequencerOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SequencerOptions buildPartial() { + spec.proto.runtime.v1.RuntimeProto.SequencerOptions result = new spec.proto.runtime.v1.RuntimeProto.SequencerOptions(this); + result.increment_ = increment_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.SequencerOptions) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.SequencerOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.SequencerOptions other) { + if (other == spec.proto.runtime.v1.RuntimeProto.SequencerOptions.getDefaultInstance()) return this; + if (other.increment_ != 0) { + setIncrementValue(other.getIncrementValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.SequencerOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.SequencerOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int increment_ = 0; + /** + * .spec.proto.runtime.v1.SequencerOptions.AutoIncrement increment = 1; + * @return The enum numeric value on the wire for increment. + */ + @java.lang.Override public int getIncrementValue() { + return increment_; + } + /** + * .spec.proto.runtime.v1.SequencerOptions.AutoIncrement increment = 1; + * @param value The enum numeric value on the wire for increment to set. + * @return This builder for chaining. + */ + public Builder setIncrementValue(int value) { + + increment_ = value; + onChanged(); + return this; + } + /** + * .spec.proto.runtime.v1.SequencerOptions.AutoIncrement increment = 1; + * @return The increment. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement getIncrement() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement result = spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement.valueOf(increment_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement.UNRECOGNIZED : result; + } + /** + * .spec.proto.runtime.v1.SequencerOptions.AutoIncrement increment = 1; + * @param value The increment to set. + * @return This builder for chaining. + */ + public Builder setIncrement(spec.proto.runtime.v1.RuntimeProto.SequencerOptions.AutoIncrement value) { + if (value == null) { + throw new NullPointerException(); + } + + increment_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .spec.proto.runtime.v1.SequencerOptions.AutoIncrement increment = 1; + * @return This builder for chaining. + */ + public Builder clearIncrement() { + + increment_ = 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:spec.proto.runtime.v1.SequencerOptions) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.SequencerOptions) + private static final spec.proto.runtime.v1.RuntimeProto.SequencerOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.SequencerOptions(); + } + + public static spec.proto.runtime.v1.RuntimeProto.SequencerOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SequencerOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SequencerOptions(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SequencerOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetNextIdResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetNextIdResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The next unique id
+     * Fixed int64 overflow problems on JavaScript https://github.com/improbable-eng/ts-protoc-gen#gotchas
+     * 
+ * + * int64 next_id = 1 [jstype = JS_STRING]; + * @return The nextId. + */ + long getNextId(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.GetNextIdResponse} + */ + public static final class GetNextIdResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetNextIdResponse) + GetNextIdResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetNextIdResponse.newBuilder() to construct. + private GetNextIdResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetNextIdResponse() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetNextIdResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetNextIdResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + nextId_ = input.readInt64(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse.class, spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse.Builder.class); + } + + public static final int NEXT_ID_FIELD_NUMBER = 1; + private long nextId_; + /** + *
+     * The next unique id
+     * Fixed int64 overflow problems on JavaScript https://github.com/improbable-eng/ts-protoc-gen#gotchas
+     * 
+ * + * int64 next_id = 1 [jstype = JS_STRING]; + * @return The nextId. + */ + @java.lang.Override + public long getNextId() { + return nextId_; + } + + 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 (nextId_ != 0L) { + output.writeInt64(1, nextId_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (nextId_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, nextId_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse other = (spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse) obj; + + if (getNextId() + != other.getNextId()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NEXT_ID_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNextId()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse 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 spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse 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 spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse 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(spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse 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 spec.proto.runtime.v1.GetNextIdResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetNextIdResponse) + spec.proto.runtime.v1.RuntimeProto.GetNextIdResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse.class, spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + nextId_ = 0L; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetNextIdResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse build() { + spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse result = new spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse(this); + result.nextId_ = nextId_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse.getDefaultInstance()) return this; + if (other.getNextId() != 0L) { + setNextId(other.getNextId()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private long nextId_ ; + /** + *
+       * The next unique id
+       * Fixed int64 overflow problems on JavaScript https://github.com/improbable-eng/ts-protoc-gen#gotchas
+       * 
+ * + * int64 next_id = 1 [jstype = JS_STRING]; + * @return The nextId. + */ + @java.lang.Override + public long getNextId() { + return nextId_; + } + /** + *
+       * The next unique id
+       * Fixed int64 overflow problems on JavaScript https://github.com/improbable-eng/ts-protoc-gen#gotchas
+       * 
+ * + * int64 next_id = 1 [jstype = JS_STRING]; + * @param value The nextId to set. + * @return This builder for chaining. + */ + public Builder setNextId(long value) { + + nextId_ = value; + onChanged(); + return this; + } + /** + *
+       * The next unique id
+       * Fixed int64 overflow problems on JavaScript https://github.com/improbable-eng/ts-protoc-gen#gotchas
+       * 
+ * + * int64 next_id = 1 [jstype = JS_STRING]; + * @return This builder for chaining. + */ + public Builder clearNextId() { + + nextId_ = 0L; + 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:spec.proto.runtime.v1.GetNextIdResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetNextIdResponse) + private static final spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetNextIdResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetNextIdResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetNextIdResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TryLockRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.TryLockRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. The lock store name,e.g. `redis`.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * Required. The lock store name,e.g. `redis`.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * Required. resource_id is the lock key. e.g. `order_id_111`
+     * It stands for "which resource I want to protect"
+     * 
+ * + * string resource_id = 2; + * @return The resourceId. + */ + java.lang.String getResourceId(); + /** + *
+     * Required. resource_id is the lock key. e.g. `order_id_111`
+     * It stands for "which resource I want to protect"
+     * 
+ * + * string resource_id = 2; + * @return The bytes for resourceId. + */ + com.google.protobuf.ByteString + getResourceIdBytes(); + + /** + *
+     * Required. lock_owner indicate the identifier of lock owner.
+     * You can generate a uuid as lock_owner.For example,in golang:
+     * req.LockOwner = uuid.New().String()
+     * This field is per request,not per process,so it is different for each request,
+     * which aims to prevent multi-thread in the same process trying the same lock concurrently.
+     * The reason why we don't make it automatically generated is:
+     * 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
+     * This name is so weird that we think it is inappropriate to put it into the api spec
+     * 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
+     * we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
+     * 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
+     * So this field in the request shouldn't be removed.
+     * 
+ * + * string lock_owner = 3; + * @return The lockOwner. + */ + java.lang.String getLockOwner(); + /** + *
+     * Required. lock_owner indicate the identifier of lock owner.
+     * You can generate a uuid as lock_owner.For example,in golang:
+     * req.LockOwner = uuid.New().String()
+     * This field is per request,not per process,so it is different for each request,
+     * which aims to prevent multi-thread in the same process trying the same lock concurrently.
+     * The reason why we don't make it automatically generated is:
+     * 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
+     * This name is so weird that we think it is inappropriate to put it into the api spec
+     * 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
+     * we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
+     * 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
+     * So this field in the request shouldn't be removed.
+     * 
+ * + * string lock_owner = 3; + * @return The bytes for lockOwner. + */ + com.google.protobuf.ByteString + getLockOwnerBytes(); + + /** + *
+     * Required. expire is the time before expire.The time unit is second.
+     * 
+ * + * int32 expire = 4; + * @return The expire. + */ + int getExpire(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.TryLockRequest} + */ + public static final class TryLockRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.TryLockRequest) + TryLockRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use TryLockRequest.newBuilder() to construct. + private TryLockRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TryLockRequest() { + storeName_ = ""; + resourceId_ = ""; + lockOwner_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TryLockRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TryLockRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + resourceId_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + lockOwner_ = s; + break; + } + case 32: { + + expire_ = input.readInt32(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TryLockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TryLockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.TryLockRequest.class, spec.proto.runtime.v1.RuntimeProto.TryLockRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * Required. The lock store name,e.g. `redis`.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * Required. The lock store name,e.g. `redis`.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object resourceId_; + /** + *
+     * Required. resource_id is the lock key. e.g. `order_id_111`
+     * It stands for "which resource I want to protect"
+     * 
+ * + * string resource_id = 2; + * @return The resourceId. + */ + @java.lang.Override + public java.lang.String getResourceId() { + java.lang.Object ref = resourceId_; + 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(); + resourceId_ = s; + return s; + } + } + /** + *
+     * Required. resource_id is the lock key. e.g. `order_id_111`
+     * It stands for "which resource I want to protect"
+     * 
+ * + * string resource_id = 2; + * @return The bytes for resourceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getResourceIdBytes() { + java.lang.Object ref = resourceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCK_OWNER_FIELD_NUMBER = 3; + private volatile java.lang.Object lockOwner_; + /** + *
+     * Required. lock_owner indicate the identifier of lock owner.
+     * You can generate a uuid as lock_owner.For example,in golang:
+     * req.LockOwner = uuid.New().String()
+     * This field is per request,not per process,so it is different for each request,
+     * which aims to prevent multi-thread in the same process trying the same lock concurrently.
+     * The reason why we don't make it automatically generated is:
+     * 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
+     * This name is so weird that we think it is inappropriate to put it into the api spec
+     * 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
+     * we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
+     * 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
+     * So this field in the request shouldn't be removed.
+     * 
+ * + * string lock_owner = 3; + * @return The lockOwner. + */ + @java.lang.Override + public java.lang.String getLockOwner() { + java.lang.Object ref = lockOwner_; + 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(); + lockOwner_ = s; + return s; + } + } + /** + *
+     * Required. lock_owner indicate the identifier of lock owner.
+     * You can generate a uuid as lock_owner.For example,in golang:
+     * req.LockOwner = uuid.New().String()
+     * This field is per request,not per process,so it is different for each request,
+     * which aims to prevent multi-thread in the same process trying the same lock concurrently.
+     * The reason why we don't make it automatically generated is:
+     * 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
+     * This name is so weird that we think it is inappropriate to put it into the api spec
+     * 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
+     * we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
+     * 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
+     * So this field in the request shouldn't be removed.
+     * 
+ * + * string lock_owner = 3; + * @return The bytes for lockOwner. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLockOwnerBytes() { + java.lang.Object ref = lockOwner_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lockOwner_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int EXPIRE_FIELD_NUMBER = 4; + private int expire_; + /** + *
+     * Required. expire is the time before expire.The time unit is second.
+     * 
+ * + * int32 expire = 4; + * @return The expire. + */ + @java.lang.Override + public int getExpire() { + return expire_; + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getResourceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceId_); + } + if (!getLockOwnerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, lockOwner_); + } + if (expire_ != 0) { + output.writeInt32(4, expire_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getResourceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceId_); + } + if (!getLockOwnerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, lockOwner_); + } + if (expire_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(4, expire_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.TryLockRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.TryLockRequest other = (spec.proto.runtime.v1.RuntimeProto.TryLockRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getResourceId() + .equals(other.getResourceId())) return false; + if (!getLockOwner() + .equals(other.getLockOwner())) return false; + if (getExpire() + != other.getExpire()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + RESOURCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getResourceId().hashCode(); + hash = (37 * hash) + LOCK_OWNER_FIELD_NUMBER; + hash = (53 * hash) + getLockOwner().hashCode(); + hash = (37 * hash) + EXPIRE_FIELD_NUMBER; + hash = (53 * hash) + getExpire(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest 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 spec.proto.runtime.v1.RuntimeProto.TryLockRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest 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 spec.proto.runtime.v1.RuntimeProto.TryLockRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest 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(spec.proto.runtime.v1.RuntimeProto.TryLockRequest 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 spec.proto.runtime.v1.TryLockRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.TryLockRequest) + spec.proto.runtime.v1.RuntimeProto.TryLockRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TryLockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TryLockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.TryLockRequest.class, spec.proto.runtime.v1.RuntimeProto.TryLockRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.TryLockRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + resourceId_ = ""; + + lockOwner_ = ""; + + expire_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TryLockRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TryLockRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.TryLockRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TryLockRequest build() { + spec.proto.runtime.v1.RuntimeProto.TryLockRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TryLockRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.TryLockRequest result = new spec.proto.runtime.v1.RuntimeProto.TryLockRequest(this); + result.storeName_ = storeName_; + result.resourceId_ = resourceId_; + result.lockOwner_ = lockOwner_; + result.expire_ = expire_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.TryLockRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.TryLockRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.TryLockRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.TryLockRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getResourceId().isEmpty()) { + resourceId_ = other.resourceId_; + onChanged(); + } + if (!other.getLockOwner().isEmpty()) { + lockOwner_ = other.lockOwner_; + onChanged(); + } + if (other.getExpire() != 0) { + setExpire(other.getExpire()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.TryLockRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.TryLockRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object storeName_ = ""; + /** + *
+       * Required. The lock store name,e.g. `redis`.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The lock store name,e.g. `redis`.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The lock store name,e.g. `redis`.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The lock store name,e.g. `redis`.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * Required. The lock store name,e.g. `redis`.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceId_ = ""; + /** + *
+       * Required. resource_id is the lock key. e.g. `order_id_111`
+       * It stands for "which resource I want to protect"
+       * 
+ * + * string resource_id = 2; + * @return The resourceId. + */ + public java.lang.String getResourceId() { + java.lang.Object ref = resourceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. resource_id is the lock key. e.g. `order_id_111`
+       * It stands for "which resource I want to protect"
+       * 
+ * + * string resource_id = 2; + * @return The bytes for resourceId. + */ + public com.google.protobuf.ByteString + getResourceIdBytes() { + java.lang.Object ref = resourceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. resource_id is the lock key. e.g. `order_id_111`
+       * It stands for "which resource I want to protect"
+       * 
+ * + * string resource_id = 2; + * @param value The resourceId to set. + * @return This builder for chaining. + */ + public Builder setResourceId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceId_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. resource_id is the lock key. e.g. `order_id_111`
+       * It stands for "which resource I want to protect"
+       * 
+ * + * string resource_id = 2; + * @return This builder for chaining. + */ + public Builder clearResourceId() { + + resourceId_ = getDefaultInstance().getResourceId(); + onChanged(); + return this; + } + /** + *
+       * Required. resource_id is the lock key. e.g. `order_id_111`
+       * It stands for "which resource I want to protect"
+       * 
+ * + * string resource_id = 2; + * @param value The bytes for resourceId to set. + * @return This builder for chaining. + */ + public Builder setResourceIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceId_ = value; + onChanged(); + return this; + } + + private java.lang.Object lockOwner_ = ""; + /** + *
+       * Required. lock_owner indicate the identifier of lock owner.
+       * You can generate a uuid as lock_owner.For example,in golang:
+       * req.LockOwner = uuid.New().String()
+       * This field is per request,not per process,so it is different for each request,
+       * which aims to prevent multi-thread in the same process trying the same lock concurrently.
+       * The reason why we don't make it automatically generated is:
+       * 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
+       * This name is so weird that we think it is inappropriate to put it into the api spec
+       * 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
+       * we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
+       * 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
+       * So this field in the request shouldn't be removed.
+       * 
+ * + * string lock_owner = 3; + * @return The lockOwner. + */ + public java.lang.String getLockOwner() { + java.lang.Object ref = lockOwner_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lockOwner_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. lock_owner indicate the identifier of lock owner.
+       * You can generate a uuid as lock_owner.For example,in golang:
+       * req.LockOwner = uuid.New().String()
+       * This field is per request,not per process,so it is different for each request,
+       * which aims to prevent multi-thread in the same process trying the same lock concurrently.
+       * The reason why we don't make it automatically generated is:
+       * 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
+       * This name is so weird that we think it is inappropriate to put it into the api spec
+       * 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
+       * we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
+       * 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
+       * So this field in the request shouldn't be removed.
+       * 
+ * + * string lock_owner = 3; + * @return The bytes for lockOwner. + */ + public com.google.protobuf.ByteString + getLockOwnerBytes() { + java.lang.Object ref = lockOwner_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lockOwner_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. lock_owner indicate the identifier of lock owner.
+       * You can generate a uuid as lock_owner.For example,in golang:
+       * req.LockOwner = uuid.New().String()
+       * This field is per request,not per process,so it is different for each request,
+       * which aims to prevent multi-thread in the same process trying the same lock concurrently.
+       * The reason why we don't make it automatically generated is:
+       * 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
+       * This name is so weird that we think it is inappropriate to put it into the api spec
+       * 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
+       * we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
+       * 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
+       * So this field in the request shouldn't be removed.
+       * 
+ * + * string lock_owner = 3; + * @param value The lockOwner to set. + * @return This builder for chaining. + */ + public Builder setLockOwner( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lockOwner_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. lock_owner indicate the identifier of lock owner.
+       * You can generate a uuid as lock_owner.For example,in golang:
+       * req.LockOwner = uuid.New().String()
+       * This field is per request,not per process,so it is different for each request,
+       * which aims to prevent multi-thread in the same process trying the same lock concurrently.
+       * The reason why we don't make it automatically generated is:
+       * 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
+       * This name is so weird that we think it is inappropriate to put it into the api spec
+       * 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
+       * we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
+       * 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
+       * So this field in the request shouldn't be removed.
+       * 
+ * + * string lock_owner = 3; + * @return This builder for chaining. + */ + public Builder clearLockOwner() { + + lockOwner_ = getDefaultInstance().getLockOwner(); + onChanged(); + return this; + } + /** + *
+       * Required. lock_owner indicate the identifier of lock owner.
+       * You can generate a uuid as lock_owner.For example,in golang:
+       * req.LockOwner = uuid.New().String()
+       * This field is per request,not per process,so it is different for each request,
+       * which aims to prevent multi-thread in the same process trying the same lock concurrently.
+       * The reason why we don't make it automatically generated is:
+       * 1. If it is automatically generated,there must be a 'my_lock_owner_id' field in the response.
+       * This name is so weird that we think it is inappropriate to put it into the api spec
+       * 2. If we change the field 'my_lock_owner_id' in the response to 'lock_owner',which means the current lock owner of this lock,
+       * we find that in some lock services users can't get the current lock owner.Actually users don't need it at all.
+       * 3. When reentrant lock is needed,the existing lock_owner is required to identify client and check "whether this client can reenter this lock".
+       * So this field in the request shouldn't be removed.
+       * 
+ * + * string lock_owner = 3; + * @param value The bytes for lockOwner to set. + * @return This builder for chaining. + */ + public Builder setLockOwnerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lockOwner_ = value; + onChanged(); + return this; + } + + private int expire_ ; + /** + *
+       * Required. expire is the time before expire.The time unit is second.
+       * 
+ * + * int32 expire = 4; + * @return The expire. + */ + @java.lang.Override + public int getExpire() { + return expire_; + } + /** + *
+       * Required. expire is the time before expire.The time unit is second.
+       * 
+ * + * int32 expire = 4; + * @param value The expire to set. + * @return This builder for chaining. + */ + public Builder setExpire(int value) { + + expire_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. expire is the time before expire.The time unit is second.
+       * 
+ * + * int32 expire = 4; + * @return This builder for chaining. + */ + public Builder clearExpire() { + + expire_ = 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:spec.proto.runtime.v1.TryLockRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.TryLockRequest) + private static final spec.proto.runtime.v1.RuntimeProto.TryLockRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.TryLockRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.TryLockRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TryLockRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TryLockRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TryLockRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TryLockResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.TryLockResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * bool success = 1; + * @return The success. + */ + boolean getSuccess(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.TryLockResponse} + */ + public static final class TryLockResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.TryLockResponse) + TryLockResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use TryLockResponse.newBuilder() to construct. + private TryLockResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TryLockResponse() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TryLockResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TryLockResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + + success_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TryLockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TryLockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.TryLockResponse.class, spec.proto.runtime.v1.RuntimeProto.TryLockResponse.Builder.class); + } + + public static final int SUCCESS_FIELD_NUMBER = 1; + private boolean success_; + /** + * bool success = 1; + * @return The success. + */ + @java.lang.Override + public boolean getSuccess() { + return success_; + } + + 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 (success_ != false) { + output.writeBool(1, success_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (success_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(1, success_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.TryLockResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.TryLockResponse other = (spec.proto.runtime.v1.RuntimeProto.TryLockResponse) obj; + + if (getSuccess() + != other.getSuccess()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + SUCCESS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSuccess()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse 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 spec.proto.runtime.v1.RuntimeProto.TryLockResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse 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 spec.proto.runtime.v1.RuntimeProto.TryLockResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse 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(spec.proto.runtime.v1.RuntimeProto.TryLockResponse 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 spec.proto.runtime.v1.TryLockResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.TryLockResponse) + spec.proto.runtime.v1.RuntimeProto.TryLockResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TryLockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TryLockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.TryLockResponse.class, spec.proto.runtime.v1.RuntimeProto.TryLockResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.TryLockResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + success_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TryLockResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TryLockResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.TryLockResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TryLockResponse build() { + spec.proto.runtime.v1.RuntimeProto.TryLockResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TryLockResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.TryLockResponse result = new spec.proto.runtime.v1.RuntimeProto.TryLockResponse(this); + result.success_ = success_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.TryLockResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.TryLockResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.TryLockResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.TryLockResponse.getDefaultInstance()) return this; + if (other.getSuccess() != false) { + setSuccess(other.getSuccess()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.TryLockResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.TryLockResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private boolean success_ ; + /** + * bool success = 1; + * @return The success. + */ + @java.lang.Override + public boolean getSuccess() { + return success_; + } + /** + * bool success = 1; + * @param value The success to set. + * @return This builder for chaining. + */ + public Builder setSuccess(boolean value) { + + success_ = value; + onChanged(); + return this; + } + /** + * bool success = 1; + * @return This builder for chaining. + */ + public Builder clearSuccess() { + + success_ = false; + 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:spec.proto.runtime.v1.TryLockResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.TryLockResponse) + private static final spec.proto.runtime.v1.RuntimeProto.TryLockResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.TryLockResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.TryLockResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TryLockResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TryLockResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TryLockResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface UnlockRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.UnlockRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * resource_id is the lock key.
+     * 
+ * + * string resource_id = 2; + * @return The resourceId. + */ + java.lang.String getResourceId(); + /** + *
+     * resource_id is the lock key.
+     * 
+ * + * string resource_id = 2; + * @return The bytes for resourceId. + */ + com.google.protobuf.ByteString + getResourceIdBytes(); + + /** + * string lock_owner = 3; + * @return The lockOwner. + */ + java.lang.String getLockOwner(); + /** + * string lock_owner = 3; + * @return The bytes for lockOwner. + */ + com.google.protobuf.ByteString + getLockOwnerBytes(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.UnlockRequest} + */ + public static final class UnlockRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.UnlockRequest) + UnlockRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use UnlockRequest.newBuilder() to construct. + private UnlockRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UnlockRequest() { + storeName_ = ""; + resourceId_ = ""; + lockOwner_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UnlockRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UnlockRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + resourceId_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + lockOwner_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_UnlockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_UnlockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.UnlockRequest.class, spec.proto.runtime.v1.RuntimeProto.UnlockRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int RESOURCE_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object resourceId_; + /** + *
+     * resource_id is the lock key.
+     * 
+ * + * string resource_id = 2; + * @return The resourceId. + */ + @java.lang.Override + public java.lang.String getResourceId() { + java.lang.Object ref = resourceId_; + 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(); + resourceId_ = s; + return s; + } + } + /** + *
+     * resource_id is the lock key.
+     * 
+ * + * string resource_id = 2; + * @return The bytes for resourceId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getResourceIdBytes() { + java.lang.Object ref = resourceId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LOCK_OWNER_FIELD_NUMBER = 3; + private volatile java.lang.Object lockOwner_; + /** + * string lock_owner = 3; + * @return The lockOwner. + */ + @java.lang.Override + public java.lang.String getLockOwner() { + java.lang.Object ref = lockOwner_; + 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(); + lockOwner_ = s; + return s; + } + } + /** + * string lock_owner = 3; + * @return The bytes for lockOwner. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLockOwnerBytes() { + java.lang.Object ref = lockOwner_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lockOwner_ = 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getResourceIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, resourceId_); + } + if (!getLockOwnerBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, lockOwner_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getResourceIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, resourceId_); + } + if (!getLockOwnerBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, lockOwner_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.UnlockRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.UnlockRequest other = (spec.proto.runtime.v1.RuntimeProto.UnlockRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getResourceId() + .equals(other.getResourceId())) return false; + if (!getLockOwner() + .equals(other.getLockOwner())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + RESOURCE_ID_FIELD_NUMBER; + hash = (53 * hash) + getResourceId().hashCode(); + hash = (37 * hash) + LOCK_OWNER_FIELD_NUMBER; + hash = (53 * hash) + getLockOwner().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest 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 spec.proto.runtime.v1.RuntimeProto.UnlockRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest 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 spec.proto.runtime.v1.RuntimeProto.UnlockRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest 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(spec.proto.runtime.v1.RuntimeProto.UnlockRequest 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 spec.proto.runtime.v1.UnlockRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.UnlockRequest) + spec.proto.runtime.v1.RuntimeProto.UnlockRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_UnlockRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_UnlockRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.UnlockRequest.class, spec.proto.runtime.v1.RuntimeProto.UnlockRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.UnlockRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + resourceId_ = ""; + + lockOwner_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_UnlockRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.UnlockRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.UnlockRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.UnlockRequest build() { + spec.proto.runtime.v1.RuntimeProto.UnlockRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.UnlockRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.UnlockRequest result = new spec.proto.runtime.v1.RuntimeProto.UnlockRequest(this); + result.storeName_ = storeName_; + result.resourceId_ = resourceId_; + result.lockOwner_ = lockOwner_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.UnlockRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.UnlockRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.UnlockRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.UnlockRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getResourceId().isEmpty()) { + resourceId_ = other.resourceId_; + onChanged(); + } + if (!other.getLockOwner().isEmpty()) { + lockOwner_ = other.lockOwner_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.UnlockRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.UnlockRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object storeName_ = ""; + /** + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object resourceId_ = ""; + /** + *
+       * resource_id is the lock key.
+       * 
+ * + * string resource_id = 2; + * @return The resourceId. + */ + public java.lang.String getResourceId() { + java.lang.Object ref = resourceId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + resourceId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * resource_id is the lock key.
+       * 
+ * + * string resource_id = 2; + * @return The bytes for resourceId. + */ + public com.google.protobuf.ByteString + getResourceIdBytes() { + java.lang.Object ref = resourceId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + resourceId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * resource_id is the lock key.
+       * 
+ * + * string resource_id = 2; + * @param value The resourceId to set. + * @return This builder for chaining. + */ + public Builder setResourceId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + resourceId_ = value; + onChanged(); + return this; + } + /** + *
+       * resource_id is the lock key.
+       * 
+ * + * string resource_id = 2; + * @return This builder for chaining. + */ + public Builder clearResourceId() { + + resourceId_ = getDefaultInstance().getResourceId(); + onChanged(); + return this; + } + /** + *
+       * resource_id is the lock key.
+       * 
+ * + * string resource_id = 2; + * @param value The bytes for resourceId to set. + * @return This builder for chaining. + */ + public Builder setResourceIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + resourceId_ = value; + onChanged(); + return this; + } + + private java.lang.Object lockOwner_ = ""; + /** + * string lock_owner = 3; + * @return The lockOwner. + */ + public java.lang.String getLockOwner() { + java.lang.Object ref = lockOwner_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + lockOwner_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string lock_owner = 3; + * @return The bytes for lockOwner. + */ + public com.google.protobuf.ByteString + getLockOwnerBytes() { + java.lang.Object ref = lockOwner_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + lockOwner_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string lock_owner = 3; + * @param value The lockOwner to set. + * @return This builder for chaining. + */ + public Builder setLockOwner( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + lockOwner_ = value; + onChanged(); + return this; + } + /** + * string lock_owner = 3; + * @return This builder for chaining. + */ + public Builder clearLockOwner() { + + lockOwner_ = getDefaultInstance().getLockOwner(); + onChanged(); + return this; + } + /** + * string lock_owner = 3; + * @param value The bytes for lockOwner to set. + * @return This builder for chaining. + */ + public Builder setLockOwnerBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + lockOwner_ = value; + 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:spec.proto.runtime.v1.UnlockRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.UnlockRequest) + private static final spec.proto.runtime.v1.RuntimeProto.UnlockRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.UnlockRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.UnlockRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UnlockRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UnlockRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.UnlockRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface UnlockResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.UnlockResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .spec.proto.runtime.v1.UnlockResponse.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + int getStatusValue(); + /** + * .spec.proto.runtime.v1.UnlockResponse.Status status = 1; + * @return The status. + */ + spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status getStatus(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.UnlockResponse} + */ + public static final class UnlockResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.UnlockResponse) + UnlockResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use UnlockResponse.newBuilder() to construct. + private UnlockResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private UnlockResponse() { + status_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new UnlockResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private UnlockResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + status_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_UnlockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_UnlockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.UnlockResponse.class, spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Builder.class); + } + + /** + * Protobuf enum {@code spec.proto.runtime.v1.UnlockResponse.Status} + */ + public enum Status + implements com.google.protobuf.ProtocolMessageEnum { + /** + * SUCCESS = 0; + */ + SUCCESS(0), + /** + * LOCK_UNEXIST = 1; + */ + LOCK_UNEXIST(1), + /** + * LOCK_BELONG_TO_OTHERS = 2; + */ + LOCK_BELONG_TO_OTHERS(2), + /** + * INTERNAL_ERROR = 3; + */ + INTERNAL_ERROR(3), + UNRECOGNIZED(-1), + ; + + /** + * SUCCESS = 0; + */ + public static final int SUCCESS_VALUE = 0; + /** + * LOCK_UNEXIST = 1; + */ + public static final int LOCK_UNEXIST_VALUE = 1; + /** + * LOCK_BELONG_TO_OTHERS = 2; + */ + public static final int LOCK_BELONG_TO_OTHERS_VALUE = 2; + /** + * INTERNAL_ERROR = 3; + */ + public static final int INTERNAL_ERROR_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 Status 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 Status forNumber(int value) { + switch (value) { + case 0: return SUCCESS; + case 1: return LOCK_UNEXIST; + case 2: return LOCK_BELONG_TO_OTHERS; + case 3: return INTERNAL_ERROR; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Status> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Status findValueByNumber(int number) { + return Status.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 spec.proto.runtime.v1.RuntimeProto.UnlockResponse.getDescriptor().getEnumTypes().get(0); + } + + private static final Status[] VALUES = values(); + + public static Status 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 Status(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:spec.proto.runtime.v1.UnlockResponse.Status) + } + + public static final int STATUS_FIELD_NUMBER = 1; + private int status_; + /** + * .spec.proto.runtime.v1.UnlockResponse.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override public int getStatusValue() { + return status_; + } + /** + * .spec.proto.runtime.v1.UnlockResponse.Status status = 1; + * @return The status. + */ + @java.lang.Override public spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status getStatus() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status result = spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status.valueOf(status_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status.UNRECOGNIZED : result; + } + + 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 (status_ != spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status.SUCCESS.getNumber()) { + output.writeEnum(1, status_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (status_ != spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status.SUCCESS.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, status_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.UnlockResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.UnlockResponse other = (spec.proto.runtime.v1.RuntimeProto.UnlockResponse) obj; + + if (status_ != other.status_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STATUS_FIELD_NUMBER; + hash = (53 * hash) + status_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse 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 spec.proto.runtime.v1.RuntimeProto.UnlockResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse 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 spec.proto.runtime.v1.RuntimeProto.UnlockResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse 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(spec.proto.runtime.v1.RuntimeProto.UnlockResponse 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 spec.proto.runtime.v1.UnlockResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.UnlockResponse) + spec.proto.runtime.v1.RuntimeProto.UnlockResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_UnlockResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_UnlockResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.UnlockResponse.class, spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.UnlockResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + status_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_UnlockResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.UnlockResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.UnlockResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.UnlockResponse build() { + spec.proto.runtime.v1.RuntimeProto.UnlockResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.UnlockResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.UnlockResponse result = new spec.proto.runtime.v1.RuntimeProto.UnlockResponse(this); + result.status_ = status_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.UnlockResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.UnlockResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.UnlockResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.UnlockResponse.getDefaultInstance()) return this; + if (other.status_ != 0) { + setStatusValue(other.getStatusValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.UnlockResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.UnlockResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int status_ = 0; + /** + * .spec.proto.runtime.v1.UnlockResponse.Status status = 1; + * @return The enum numeric value on the wire for status. + */ + @java.lang.Override public int getStatusValue() { + return status_; + } + /** + * .spec.proto.runtime.v1.UnlockResponse.Status status = 1; + * @param value The enum numeric value on the wire for status to set. + * @return This builder for chaining. + */ + public Builder setStatusValue(int value) { + + status_ = value; + onChanged(); + return this; + } + /** + * .spec.proto.runtime.v1.UnlockResponse.Status status = 1; + * @return The status. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status getStatus() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status result = spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status.valueOf(status_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status.UNRECOGNIZED : result; + } + /** + * .spec.proto.runtime.v1.UnlockResponse.Status status = 1; + * @param value The status to set. + * @return This builder for chaining. + */ + public Builder setStatus(spec.proto.runtime.v1.RuntimeProto.UnlockResponse.Status value) { + if (value == null) { + throw new NullPointerException(); + } + + status_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .spec.proto.runtime.v1.UnlockResponse.Status status = 1; + * @return This builder for chaining. + */ + public Builder clearStatus() { + + status_ = 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:spec.proto.runtime.v1.UnlockResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.UnlockResponse) + private static final spec.proto.runtime.v1.RuntimeProto.UnlockResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.UnlockResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.UnlockResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public UnlockResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new UnlockResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.UnlockResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SayHelloRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.SayHelloRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string service_name = 1; + * @return The serviceName. + */ + java.lang.String getServiceName(); + /** + * string service_name = 1; + * @return The bytes for serviceName. + */ + com.google.protobuf.ByteString + getServiceNameBytes(); + + /** + * string name = 2; + * @return The name. + */ + java.lang.String getName(); + /** + * string name = 2; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+     * Optional. This field is used to control the packet size during load tests.
+     * 
+ * + * .google.protobuf.Any data = 3; + * @return Whether the data field is set. + */ + boolean hasData(); + /** + *
+     * Optional. This field is used to control the packet size during load tests.
+     * 
+ * + * .google.protobuf.Any data = 3; + * @return The data. + */ + com.google.protobuf.Any getData(); + /** + *
+     * Optional. This field is used to control the packet size during load tests.
+     * 
+ * + * .google.protobuf.Any data = 3; + */ + com.google.protobuf.AnyOrBuilder getDataOrBuilder(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.SayHelloRequest} + */ + public static final class SayHelloRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.SayHelloRequest) + SayHelloRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SayHelloRequest.newBuilder() to construct. + private SayHelloRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SayHelloRequest() { + serviceName_ = ""; + name_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SayHelloRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SayHelloRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + serviceName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 26: { + com.google.protobuf.Any.Builder subBuilder = null; + if (data_ != null) { + subBuilder = data_.toBuilder(); + } + data_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(data_); + data_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SayHelloRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SayHelloRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SayHelloRequest.class, spec.proto.runtime.v1.RuntimeProto.SayHelloRequest.Builder.class); + } + + public static final int SERVICE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object serviceName_; + /** + * string service_name = 1; + * @return The serviceName. + */ + @java.lang.Override + public java.lang.String getServiceName() { + java.lang.Object ref = serviceName_; + 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(); + serviceName_ = s; + return s; + } + } + /** + * string service_name = 1; + * @return The bytes for serviceName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getServiceNameBytes() { + java.lang.Object ref = serviceName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int NAME_FIELD_NUMBER = 2; + private volatile java.lang.Object name_; + /** + * string name = 2; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + * string name = 2; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 3; + private com.google.protobuf.Any data_; + /** + *
+     * Optional. This field is used to control the packet size during load tests.
+     * 
+ * + * .google.protobuf.Any data = 3; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return data_ != null; + } + /** + *
+     * Optional. This field is used to control the packet size during load tests.
+     * 
+ * + * .google.protobuf.Any data = 3; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.Any getData() { + return data_ == null ? com.google.protobuf.Any.getDefaultInstance() : data_; + } + /** + *
+     * Optional. This field is used to control the packet size during load tests.
+     * 
+ * + * .google.protobuf.Any data = 3; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDataOrBuilder() { + return getData(); + } + + 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 (!getServiceNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, serviceName_); + } + if (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, name_); + } + if (data_ != null) { + output.writeMessage(3, getData()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getServiceNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, serviceName_); + } + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, name_); + } + if (data_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getData()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.SayHelloRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.SayHelloRequest other = (spec.proto.runtime.v1.RuntimeProto.SayHelloRequest) obj; + + if (!getServiceName() + .equals(other.getServiceName())) return false; + if (!getName() + .equals(other.getName())) return false; + if (hasData() != other.hasData()) return false; + if (hasData()) { + if (!getData() + .equals(other.getData())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + SERVICE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getServiceName().hashCode(); + hash = (37 * hash) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + if (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest 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 spec.proto.runtime.v1.RuntimeProto.SayHelloRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest 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 spec.proto.runtime.v1.RuntimeProto.SayHelloRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest 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(spec.proto.runtime.v1.RuntimeProto.SayHelloRequest 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 spec.proto.runtime.v1.SayHelloRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.SayHelloRequest) + spec.proto.runtime.v1.RuntimeProto.SayHelloRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SayHelloRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SayHelloRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SayHelloRequest.class, spec.proto.runtime.v1.RuntimeProto.SayHelloRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.SayHelloRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + serviceName_ = ""; + + name_ = ""; + + if (dataBuilder_ == null) { + data_ = null; + } else { + data_ = null; + dataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SayHelloRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SayHelloRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.SayHelloRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SayHelloRequest build() { + spec.proto.runtime.v1.RuntimeProto.SayHelloRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SayHelloRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.SayHelloRequest result = new spec.proto.runtime.v1.RuntimeProto.SayHelloRequest(this); + result.serviceName_ = serviceName_; + result.name_ = name_; + if (dataBuilder_ == null) { + result.data_ = data_; + } else { + result.data_ = dataBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.SayHelloRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.SayHelloRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.SayHelloRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.SayHelloRequest.getDefaultInstance()) return this; + if (!other.getServiceName().isEmpty()) { + serviceName_ = other.serviceName_; + onChanged(); + } + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.hasData()) { + mergeData(other.getData()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.SayHelloRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.SayHelloRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object serviceName_ = ""; + /** + * string service_name = 1; + * @return The serviceName. + */ + public java.lang.String getServiceName() { + java.lang.Object ref = serviceName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + serviceName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string service_name = 1; + * @return The bytes for serviceName. + */ + public com.google.protobuf.ByteString + getServiceNameBytes() { + java.lang.Object ref = serviceName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + serviceName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string service_name = 1; + * @param value The serviceName to set. + * @return This builder for chaining. + */ + public Builder setServiceName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + serviceName_ = value; + onChanged(); + return this; + } + /** + * string service_name = 1; + * @return This builder for chaining. + */ + public Builder clearServiceName() { + + serviceName_ = getDefaultInstance().getServiceName(); + onChanged(); + return this; + } + /** + * string service_name = 1; + * @param value The bytes for serviceName to set. + * @return This builder for chaining. + */ + public Builder setServiceNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + serviceName_ = value; + onChanged(); + return this; + } + + private java.lang.Object name_ = ""; + /** + * string name = 2; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string name = 2; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string name = 2; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + * string name = 2; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + * string name = 2; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Any data_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> dataBuilder_; + /** + *
+       * Optional. This field is used to control the packet size during load tests.
+       * 
+ * + * .google.protobuf.Any data = 3; + * @return Whether the data field is set. + */ + public boolean hasData() { + return dataBuilder_ != null || data_ != null; + } + /** + *
+       * Optional. This field is used to control the packet size during load tests.
+       * 
+ * + * .google.protobuf.Any data = 3; + * @return The data. + */ + public com.google.protobuf.Any getData() { + if (dataBuilder_ == null) { + return data_ == null ? com.google.protobuf.Any.getDefaultInstance() : data_; + } else { + return dataBuilder_.getMessage(); + } + } + /** + *
+       * Optional. This field is used to control the packet size during load tests.
+       * 
+ * + * .google.protobuf.Any data = 3; + */ + public Builder setData(com.google.protobuf.Any value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + dataBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Optional. This field is used to control the packet size during load tests.
+       * 
+ * + * .google.protobuf.Any data = 3; + */ + public Builder setData( + com.google.protobuf.Any.Builder builderForValue) { + if (dataBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Optional. This field is used to control the packet size during load tests.
+       * 
+ * + * .google.protobuf.Any data = 3; + */ + public Builder mergeData(com.google.protobuf.Any value) { + if (dataBuilder_ == null) { + if (data_ != null) { + data_ = + com.google.protobuf.Any.newBuilder(data_).mergeFrom(value).buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + dataBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Optional. This field is used to control the packet size during load tests.
+       * 
+ * + * .google.protobuf.Any data = 3; + */ + public Builder clearData() { + if (dataBuilder_ == null) { + data_ = null; + onChanged(); + } else { + data_ = null; + dataBuilder_ = null; + } + + return this; + } + /** + *
+       * Optional. This field is used to control the packet size during load tests.
+       * 
+ * + * .google.protobuf.Any data = 3; + */ + public com.google.protobuf.Any.Builder getDataBuilder() { + + onChanged(); + return getDataFieldBuilder().getBuilder(); + } + /** + *
+       * Optional. This field is used to control the packet size during load tests.
+       * 
+ * + * .google.protobuf.Any data = 3; + */ + public com.google.protobuf.AnyOrBuilder getDataOrBuilder() { + if (dataBuilder_ != null) { + return dataBuilder_.getMessageOrBuilder(); + } else { + return data_ == null ? + com.google.protobuf.Any.getDefaultInstance() : data_; + } + } + /** + *
+       * Optional. This field is used to control the packet size during load tests.
+       * 
+ * + * .google.protobuf.Any data = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getDataFieldBuilder() { + if (dataBuilder_ == null) { + dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + getData(), + getParentForChildren(), + isClean()); + data_ = null; + } + return dataBuilder_; + } + @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:spec.proto.runtime.v1.SayHelloRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.SayHelloRequest) + private static final spec.proto.runtime.v1.RuntimeProto.SayHelloRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.SayHelloRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.SayHelloRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SayHelloRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SayHelloRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SayHelloRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SayHelloResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.SayHelloResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * string hello = 1; + * @return The hello. + */ + java.lang.String getHello(); + /** + * string hello = 1; + * @return The bytes for hello. + */ + com.google.protobuf.ByteString + getHelloBytes(); + + /** + * .google.protobuf.Any data = 2; + * @return Whether the data field is set. + */ + boolean hasData(); + /** + * .google.protobuf.Any data = 2; + * @return The data. + */ + com.google.protobuf.Any getData(); + /** + * .google.protobuf.Any data = 2; + */ + com.google.protobuf.AnyOrBuilder getDataOrBuilder(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.SayHelloResponse} + */ + public static final class SayHelloResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.SayHelloResponse) + SayHelloResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SayHelloResponse.newBuilder() to construct. + private SayHelloResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SayHelloResponse() { + hello_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SayHelloResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SayHelloResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + hello_ = s; + break; + } + case 18: { + com.google.protobuf.Any.Builder subBuilder = null; + if (data_ != null) { + subBuilder = data_.toBuilder(); + } + data_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(data_); + data_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SayHelloResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SayHelloResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SayHelloResponse.class, spec.proto.runtime.v1.RuntimeProto.SayHelloResponse.Builder.class); + } + + public static final int HELLO_FIELD_NUMBER = 1; + private volatile java.lang.Object hello_; + /** + * string hello = 1; + * @return The hello. + */ + @java.lang.Override + public java.lang.String getHello() { + java.lang.Object ref = hello_; + 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(); + hello_ = s; + return s; + } + } + /** + * string hello = 1; + * @return The bytes for hello. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getHelloBytes() { + java.lang.Object ref = hello_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hello_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.Any data_; + /** + * .google.protobuf.Any data = 2; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return data_ != null; + } + /** + * .google.protobuf.Any data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.Any getData() { + return data_ == null ? com.google.protobuf.Any.getDefaultInstance() : data_; + } + /** + * .google.protobuf.Any data = 2; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDataOrBuilder() { + return getData(); + } + + 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 (!getHelloBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, hello_); + } + if (data_ != null) { + output.writeMessage(2, getData()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getHelloBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, hello_); + } + if (data_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getData()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.SayHelloResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.SayHelloResponse other = (spec.proto.runtime.v1.RuntimeProto.SayHelloResponse) obj; + + if (!getHello() + .equals(other.getHello())) return false; + if (hasData() != other.hasData()) return false; + if (hasData()) { + if (!getData() + .equals(other.getData())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + HELLO_FIELD_NUMBER; + hash = (53 * hash) + getHello().hashCode(); + if (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse 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 spec.proto.runtime.v1.RuntimeProto.SayHelloResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse 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 spec.proto.runtime.v1.RuntimeProto.SayHelloResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse 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(spec.proto.runtime.v1.RuntimeProto.SayHelloResponse 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 spec.proto.runtime.v1.SayHelloResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.SayHelloResponse) + spec.proto.runtime.v1.RuntimeProto.SayHelloResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SayHelloResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SayHelloResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SayHelloResponse.class, spec.proto.runtime.v1.RuntimeProto.SayHelloResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.SayHelloResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + hello_ = ""; + + if (dataBuilder_ == null) { + data_ = null; + } else { + data_ = null; + dataBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SayHelloResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SayHelloResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.SayHelloResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SayHelloResponse build() { + spec.proto.runtime.v1.RuntimeProto.SayHelloResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SayHelloResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.SayHelloResponse result = new spec.proto.runtime.v1.RuntimeProto.SayHelloResponse(this); + result.hello_ = hello_; + if (dataBuilder_ == null) { + result.data_ = data_; + } else { + result.data_ = dataBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.SayHelloResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.SayHelloResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.SayHelloResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.SayHelloResponse.getDefaultInstance()) return this; + if (!other.getHello().isEmpty()) { + hello_ = other.hello_; + onChanged(); + } + if (other.hasData()) { + mergeData(other.getData()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.SayHelloResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.SayHelloResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object hello_ = ""; + /** + * string hello = 1; + * @return The hello. + */ + public java.lang.String getHello() { + java.lang.Object ref = hello_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + hello_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string hello = 1; + * @return The bytes for hello. + */ + public com.google.protobuf.ByteString + getHelloBytes() { + java.lang.Object ref = hello_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + hello_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string hello = 1; + * @param value The hello to set. + * @return This builder for chaining. + */ + public Builder setHello( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + hello_ = value; + onChanged(); + return this; + } + /** + * string hello = 1; + * @return This builder for chaining. + */ + public Builder clearHello() { + + hello_ = getDefaultInstance().getHello(); + onChanged(); + return this; + } + /** + * string hello = 1; + * @param value The bytes for hello to set. + * @return This builder for chaining. + */ + public Builder setHelloBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + hello_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Any data_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> dataBuilder_; + /** + * .google.protobuf.Any data = 2; + * @return Whether the data field is set. + */ + public boolean hasData() { + return dataBuilder_ != null || data_ != null; + } + /** + * .google.protobuf.Any data = 2; + * @return The data. + */ + public com.google.protobuf.Any getData() { + if (dataBuilder_ == null) { + return data_ == null ? com.google.protobuf.Any.getDefaultInstance() : data_; + } else { + return dataBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Any data = 2; + */ + public Builder setData(com.google.protobuf.Any value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + dataBuilder_.setMessage(value); + } + + return this; + } + /** + * .google.protobuf.Any data = 2; + */ + public Builder setData( + com.google.protobuf.Any.Builder builderForValue) { + if (dataBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .google.protobuf.Any data = 2; + */ + public Builder mergeData(com.google.protobuf.Any value) { + if (dataBuilder_ == null) { + if (data_ != null) { + data_ = + com.google.protobuf.Any.newBuilder(data_).mergeFrom(value).buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + dataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .google.protobuf.Any data = 2; + */ + public Builder clearData() { + if (dataBuilder_ == null) { + data_ = null; + onChanged(); + } else { + data_ = null; + dataBuilder_ = null; + } + + return this; + } + /** + * .google.protobuf.Any data = 2; + */ + public com.google.protobuf.Any.Builder getDataBuilder() { + + onChanged(); + return getDataFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Any data = 2; + */ + public com.google.protobuf.AnyOrBuilder getDataOrBuilder() { + if (dataBuilder_ != null) { + return dataBuilder_.getMessageOrBuilder(); + } else { + return data_ == null ? + com.google.protobuf.Any.getDefaultInstance() : data_; + } + } + /** + * .google.protobuf.Any data = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getDataFieldBuilder() { + if (dataBuilder_ == null) { + dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + getData(), + getParentForChildren(), + isClean()); + data_ = null; + } + return dataBuilder_; + } + @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:spec.proto.runtime.v1.SayHelloResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.SayHelloResponse) + private static final spec.proto.runtime.v1.RuntimeProto.SayHelloResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.SayHelloResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.SayHelloResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SayHelloResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SayHelloResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SayHelloResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface InvokeServiceRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.InvokeServiceRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string id = 1; + * @return The id. + */ + java.lang.String getId(); + /** + * string id = 1; + * @return The bytes for id. + */ + com.google.protobuf.ByteString + getIdBytes(); + + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + * @return Whether the message field is set. + */ + boolean hasMessage(); + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + * @return The message. + */ + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest getMessage(); + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + */ + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequestOrBuilder getMessageOrBuilder(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.InvokeServiceRequest} + */ + public static final class InvokeServiceRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.InvokeServiceRequest) + InvokeServiceRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use InvokeServiceRequest.newBuilder() to construct. + private InvokeServiceRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private InvokeServiceRequest() { + id_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new InvokeServiceRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private InvokeServiceRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + id_ = s; + break; + } + case 26: { + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.Builder subBuilder = null; + if (message_ != null) { + subBuilder = message_.toBuilder(); + } + message_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(message_); + message_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest.class, spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest.Builder.class); + } + + public static final int ID_FIELD_NUMBER = 1; + private volatile java.lang.Object id_; + /** + * string id = 1; + * @return The id. + */ + @java.lang.Override + public java.lang.String getId() { + java.lang.Object ref = id_; + 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(); + id_ = s; + return s; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int MESSAGE_FIELD_NUMBER = 3; + private spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest message_; + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + * @return Whether the message field is set. + */ + @java.lang.Override + public boolean hasMessage() { + return message_ != null; + } + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + * @return The message. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest getMessage() { + return message_ == null ? spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.getDefaultInstance() : message_; + } + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequestOrBuilder getMessageOrBuilder() { + return getMessage(); + } + + 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 (!getIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, id_); + } + if (message_ != null) { + output.writeMessage(3, getMessage()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, id_); + } + if (message_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getMessage()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest other = (spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest) obj; + + if (!getId() + .equals(other.getId())) return false; + if (hasMessage() != other.hasMessage()) return false; + if (hasMessage()) { + if (!getMessage() + .equals(other.getMessage())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + ID_FIELD_NUMBER; + hash = (53 * hash) + getId().hashCode(); + if (hasMessage()) { + hash = (37 * hash) + MESSAGE_FIELD_NUMBER; + hash = (53 * hash) + getMessage().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest 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 spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest 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 spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest 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(spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest 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 spec.proto.runtime.v1.InvokeServiceRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.InvokeServiceRequest) + spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeServiceRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeServiceRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest.class, spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + id_ = ""; + + if (messageBuilder_ == null) { + message_ = null; + } else { + message_ = null; + messageBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeServiceRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest build() { + spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest result = new spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest(this); + result.id_ = id_; + if (messageBuilder_ == null) { + result.message_ = message_; + } else { + result.message_ = messageBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest.getDefaultInstance()) return this; + if (!other.getId().isEmpty()) { + id_ = other.id_; + onChanged(); + } + if (other.hasMessage()) { + mergeMessage(other.getMessage()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object id_ = ""; + /** + * string id = 1; + * @return The id. + */ + public java.lang.String getId() { + java.lang.Object ref = id_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + id_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string id = 1; + * @return The bytes for id. + */ + public com.google.protobuf.ByteString + getIdBytes() { + java.lang.Object ref = id_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + id_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string id = 1; + * @param value The id to set. + * @return This builder for chaining. + */ + public Builder setId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + id_ = value; + onChanged(); + return this; + } + /** + * string id = 1; + * @return This builder for chaining. + */ + public Builder clearId() { + + id_ = getDefaultInstance().getId(); + onChanged(); + return this; + } + /** + * string id = 1; + * @param value The bytes for id to set. + * @return This builder for chaining. + */ + public Builder setIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + id_ = value; + onChanged(); + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest message_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest, spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.Builder, spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequestOrBuilder> messageBuilder_; + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + * @return Whether the message field is set. + */ + public boolean hasMessage() { + return messageBuilder_ != null || message_ != null; + } + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + * @return The message. + */ + public spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest getMessage() { + if (messageBuilder_ == null) { + return message_ == null ? spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.getDefaultInstance() : message_; + } else { + return messageBuilder_.getMessage(); + } + } + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + */ + public Builder setMessage(spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest value) { + if (messageBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + message_ = value; + onChanged(); + } else { + messageBuilder_.setMessage(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + */ + public Builder setMessage( + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.Builder builderForValue) { + if (messageBuilder_ == null) { + message_ = builderForValue.build(); + onChanged(); + } else { + messageBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + */ + public Builder mergeMessage(spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest value) { + if (messageBuilder_ == null) { + if (message_ != null) { + message_ = + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.newBuilder(message_).mergeFrom(value).buildPartial(); + } else { + message_ = value; + } + onChanged(); + } else { + messageBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + */ + public Builder clearMessage() { + if (messageBuilder_ == null) { + message_ = null; + onChanged(); + } else { + message_ = null; + messageBuilder_ = null; + } + + return this; + } + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.Builder getMessageBuilder() { + + onChanged(); + return getMessageFieldBuilder().getBuilder(); + } + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequestOrBuilder getMessageOrBuilder() { + if (messageBuilder_ != null) { + return messageBuilder_.getMessageOrBuilder(); + } else { + return message_ == null ? + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.getDefaultInstance() : message_; + } + } + /** + * .spec.proto.runtime.v1.CommonInvokeRequest message = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest, spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.Builder, spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequestOrBuilder> + getMessageFieldBuilder() { + if (messageBuilder_ == null) { + messageBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest, spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.Builder, spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequestOrBuilder>( + getMessage(), + getParentForChildren(), + isClean()); + message_ = null; + } + return messageBuilder_; + } + @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:spec.proto.runtime.v1.InvokeServiceRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.InvokeServiceRequest) + private static final spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InvokeServiceRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InvokeServiceRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeServiceRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface CommonInvokeRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.CommonInvokeRequest) + com.google.protobuf.MessageOrBuilder { + + /** + * string method = 1; + * @return The method. + */ + java.lang.String getMethod(); + /** + * string method = 1; + * @return The bytes for method. + */ + com.google.protobuf.ByteString + getMethodBytes(); + + /** + * .google.protobuf.Any data = 2; + * @return Whether the data field is set. + */ + boolean hasData(); + /** + * .google.protobuf.Any data = 2; + * @return The data. + */ + com.google.protobuf.Any getData(); + /** + * .google.protobuf.Any data = 2; + */ + com.google.protobuf.AnyOrBuilder getDataOrBuilder(); + + /** + * string content_type = 3; + * @return The contentType. + */ + java.lang.String getContentType(); + /** + * string content_type = 3; + * @return The bytes for contentType. + */ + com.google.protobuf.ByteString + getContentTypeBytes(); + + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + * @return Whether the httpExtension field is set. + */ + boolean hasHttpExtension(); + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + * @return The httpExtension. + */ + spec.proto.runtime.v1.RuntimeProto.HTTPExtension getHttpExtension(); + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + */ + spec.proto.runtime.v1.RuntimeProto.HTTPExtensionOrBuilder getHttpExtensionOrBuilder(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.CommonInvokeRequest} + */ + public static final class CommonInvokeRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.CommonInvokeRequest) + CommonInvokeRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use CommonInvokeRequest.newBuilder() to construct. + private CommonInvokeRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private CommonInvokeRequest() { + method_ = ""; + contentType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new CommonInvokeRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private CommonInvokeRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + method_ = s; + break; + } + case 18: { + com.google.protobuf.Any.Builder subBuilder = null; + if (data_ != null) { + subBuilder = data_.toBuilder(); + } + data_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(data_); + data_ = subBuilder.buildPartial(); + } + + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + contentType_ = s; + break; + } + case 34: { + spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Builder subBuilder = null; + if (httpExtension_ != null) { + subBuilder = httpExtension_.toBuilder(); + } + httpExtension_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.HTTPExtension.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(httpExtension_); + httpExtension_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_CommonInvokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_CommonInvokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.class, spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.Builder.class); + } + + public static final int METHOD_FIELD_NUMBER = 1; + private volatile java.lang.Object method_; + /** + * string method = 1; + * @return The method. + */ + @java.lang.Override + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } + } + /** + * string method = 1; + * @return The bytes for method. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.Any data_; + /** + * .google.protobuf.Any data = 2; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return data_ != null; + } + /** + * .google.protobuf.Any data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.Any getData() { + return data_ == null ? com.google.protobuf.Any.getDefaultInstance() : data_; + } + /** + * .google.protobuf.Any data = 2; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDataOrBuilder() { + return getData(); + } + + public static final int CONTENT_TYPE_FIELD_NUMBER = 3; + private volatile java.lang.Object contentType_; + /** + * string content_type = 3; + * @return The contentType. + */ + @java.lang.Override + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + 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(); + contentType_ = s; + return s; + } + } + /** + * string content_type = 3; + * @return The bytes for contentType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int HTTP_EXTENSION_FIELD_NUMBER = 4; + private spec.proto.runtime.v1.RuntimeProto.HTTPExtension httpExtension_; + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + * @return Whether the httpExtension field is set. + */ + @java.lang.Override + public boolean hasHttpExtension() { + return httpExtension_ != null; + } + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + * @return The httpExtension. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.HTTPExtension getHttpExtension() { + return httpExtension_ == null ? spec.proto.runtime.v1.RuntimeProto.HTTPExtension.getDefaultInstance() : httpExtension_; + } + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.HTTPExtensionOrBuilder getHttpExtensionOrBuilder() { + return getHttpExtension(); + } + + 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 (!getMethodBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, method_); + } + if (data_ != null) { + output.writeMessage(2, getData()); + } + if (!getContentTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, contentType_); + } + if (httpExtension_ != null) { + output.writeMessage(4, getHttpExtension()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getMethodBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, method_); + } + if (data_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getData()); + } + if (!getContentTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, contentType_); + } + if (httpExtension_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getHttpExtension()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest other = (spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest) obj; + + if (!getMethod() + .equals(other.getMethod())) return false; + if (hasData() != other.hasData()) return false; + if (hasData()) { + if (!getData() + .equals(other.getData())) return false; + } + if (!getContentType() + .equals(other.getContentType())) return false; + if (hasHttpExtension() != other.hasHttpExtension()) return false; + if (hasHttpExtension()) { + if (!getHttpExtension() + .equals(other.getHttpExtension())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + METHOD_FIELD_NUMBER; + hash = (53 * hash) + getMethod().hashCode(); + if (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getContentType().hashCode(); + if (hasHttpExtension()) { + hash = (37 * hash) + HTTP_EXTENSION_FIELD_NUMBER; + hash = (53 * hash) + getHttpExtension().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest 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 spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest 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 spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest 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(spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest 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 spec.proto.runtime.v1.CommonInvokeRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.CommonInvokeRequest) + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_CommonInvokeRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_CommonInvokeRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.class, spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + method_ = ""; + + if (dataBuilder_ == null) { + data_ = null; + } else { + data_ = null; + dataBuilder_ = null; + } + contentType_ = ""; + + if (httpExtensionBuilder_ == null) { + httpExtension_ = null; + } else { + httpExtension_ = null; + httpExtensionBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_CommonInvokeRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest build() { + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest result = new spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest(this); + result.method_ = method_; + if (dataBuilder_ == null) { + result.data_ = data_; + } else { + result.data_ = dataBuilder_.build(); + } + result.contentType_ = contentType_; + if (httpExtensionBuilder_ == null) { + result.httpExtension_ = httpExtension_; + } else { + result.httpExtension_ = httpExtensionBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest.getDefaultInstance()) return this; + if (!other.getMethod().isEmpty()) { + method_ = other.method_; + onChanged(); + } + if (other.hasData()) { + mergeData(other.getData()); + } + if (!other.getContentType().isEmpty()) { + contentType_ = other.contentType_; + onChanged(); + } + if (other.hasHttpExtension()) { + mergeHttpExtension(other.getHttpExtension()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object method_ = ""; + /** + * string method = 1; + * @return The method. + */ + public java.lang.String getMethod() { + java.lang.Object ref = method_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + method_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string method = 1; + * @return The bytes for method. + */ + public com.google.protobuf.ByteString + getMethodBytes() { + java.lang.Object ref = method_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + method_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string method = 1; + * @param value The method to set. + * @return This builder for chaining. + */ + public Builder setMethod( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + method_ = value; + onChanged(); + return this; + } + /** + * string method = 1; + * @return This builder for chaining. + */ + public Builder clearMethod() { + + method_ = getDefaultInstance().getMethod(); + onChanged(); + return this; + } + /** + * string method = 1; + * @param value The bytes for method to set. + * @return This builder for chaining. + */ + public Builder setMethodBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + method_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.Any data_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> dataBuilder_; + /** + * .google.protobuf.Any data = 2; + * @return Whether the data field is set. + */ + public boolean hasData() { + return dataBuilder_ != null || data_ != null; + } + /** + * .google.protobuf.Any data = 2; + * @return The data. + */ + public com.google.protobuf.Any getData() { + if (dataBuilder_ == null) { + return data_ == null ? com.google.protobuf.Any.getDefaultInstance() : data_; + } else { + return dataBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Any data = 2; + */ + public Builder setData(com.google.protobuf.Any value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + dataBuilder_.setMessage(value); + } + + return this; + } + /** + * .google.protobuf.Any data = 2; + */ + public Builder setData( + com.google.protobuf.Any.Builder builderForValue) { + if (dataBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .google.protobuf.Any data = 2; + */ + public Builder mergeData(com.google.protobuf.Any value) { + if (dataBuilder_ == null) { + if (data_ != null) { + data_ = + com.google.protobuf.Any.newBuilder(data_).mergeFrom(value).buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + dataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .google.protobuf.Any data = 2; + */ + public Builder clearData() { + if (dataBuilder_ == null) { + data_ = null; + onChanged(); + } else { + data_ = null; + dataBuilder_ = null; + } + + return this; + } + /** + * .google.protobuf.Any data = 2; + */ + public com.google.protobuf.Any.Builder getDataBuilder() { + + onChanged(); + return getDataFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Any data = 2; + */ + public com.google.protobuf.AnyOrBuilder getDataOrBuilder() { + if (dataBuilder_ != null) { + return dataBuilder_.getMessageOrBuilder(); + } else { + return data_ == null ? + com.google.protobuf.Any.getDefaultInstance() : data_; + } + } + /** + * .google.protobuf.Any data = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getDataFieldBuilder() { + if (dataBuilder_ == null) { + dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + getData(), + getParentForChildren(), + isClean()); + data_ = null; + } + return dataBuilder_; + } + + private java.lang.Object contentType_ = ""; + /** + * string content_type = 3; + * @return The contentType. + */ + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content_type = 3; + * @return The bytes for contentType. + */ + public com.google.protobuf.ByteString + getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content_type = 3; + * @param value The contentType to set. + * @return This builder for chaining. + */ + public Builder setContentType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + contentType_ = value; + onChanged(); + return this; + } + /** + * string content_type = 3; + * @return This builder for chaining. + */ + public Builder clearContentType() { + + contentType_ = getDefaultInstance().getContentType(); + onChanged(); + return this; + } + /** + * string content_type = 3; + * @param value The bytes for contentType to set. + * @return This builder for chaining. + */ + public Builder setContentTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + contentType_ = value; + onChanged(); + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.HTTPExtension httpExtension_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.HTTPExtension, spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Builder, spec.proto.runtime.v1.RuntimeProto.HTTPExtensionOrBuilder> httpExtensionBuilder_; + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + * @return Whether the httpExtension field is set. + */ + public boolean hasHttpExtension() { + return httpExtensionBuilder_ != null || httpExtension_ != null; + } + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + * @return The httpExtension. + */ + public spec.proto.runtime.v1.RuntimeProto.HTTPExtension getHttpExtension() { + if (httpExtensionBuilder_ == null) { + return httpExtension_ == null ? spec.proto.runtime.v1.RuntimeProto.HTTPExtension.getDefaultInstance() : httpExtension_; + } else { + return httpExtensionBuilder_.getMessage(); + } + } + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + */ + public Builder setHttpExtension(spec.proto.runtime.v1.RuntimeProto.HTTPExtension value) { + if (httpExtensionBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + httpExtension_ = value; + onChanged(); + } else { + httpExtensionBuilder_.setMessage(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + */ + public Builder setHttpExtension( + spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Builder builderForValue) { + if (httpExtensionBuilder_ == null) { + httpExtension_ = builderForValue.build(); + onChanged(); + } else { + httpExtensionBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + */ + public Builder mergeHttpExtension(spec.proto.runtime.v1.RuntimeProto.HTTPExtension value) { + if (httpExtensionBuilder_ == null) { + if (httpExtension_ != null) { + httpExtension_ = + spec.proto.runtime.v1.RuntimeProto.HTTPExtension.newBuilder(httpExtension_).mergeFrom(value).buildPartial(); + } else { + httpExtension_ = value; + } + onChanged(); + } else { + httpExtensionBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + */ + public Builder clearHttpExtension() { + if (httpExtensionBuilder_ == null) { + httpExtension_ = null; + onChanged(); + } else { + httpExtension_ = null; + httpExtensionBuilder_ = null; + } + + return this; + } + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + */ + public spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Builder getHttpExtensionBuilder() { + + onChanged(); + return getHttpExtensionFieldBuilder().getBuilder(); + } + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + */ + public spec.proto.runtime.v1.RuntimeProto.HTTPExtensionOrBuilder getHttpExtensionOrBuilder() { + if (httpExtensionBuilder_ != null) { + return httpExtensionBuilder_.getMessageOrBuilder(); + } else { + return httpExtension_ == null ? + spec.proto.runtime.v1.RuntimeProto.HTTPExtension.getDefaultInstance() : httpExtension_; + } + } + /** + * .spec.proto.runtime.v1.HTTPExtension http_extension = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.HTTPExtension, spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Builder, spec.proto.runtime.v1.RuntimeProto.HTTPExtensionOrBuilder> + getHttpExtensionFieldBuilder() { + if (httpExtensionBuilder_ == null) { + httpExtensionBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.HTTPExtension, spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Builder, spec.proto.runtime.v1.RuntimeProto.HTTPExtensionOrBuilder>( + getHttpExtension(), + getParentForChildren(), + isClean()); + httpExtension_ = null; + } + return httpExtensionBuilder_; + } + @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:spec.proto.runtime.v1.CommonInvokeRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.CommonInvokeRequest) + private static final spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public CommonInvokeRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new CommonInvokeRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.CommonInvokeRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface HTTPExtensionOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.HTTPExtension) + com.google.protobuf.MessageOrBuilder { + + /** + * .spec.proto.runtime.v1.HTTPExtension.Verb verb = 1; + * @return The enum numeric value on the wire for verb. + */ + int getVerbValue(); + /** + * .spec.proto.runtime.v1.HTTPExtension.Verb verb = 1; + * @return The verb. + */ + spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb getVerb(); + + /** + * string querystring = 2; + * @return The querystring. + */ + java.lang.String getQuerystring(); + /** + * string querystring = 2; + * @return The bytes for querystring. + */ + com.google.protobuf.ByteString + getQuerystringBytes(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.HTTPExtension} + */ + public static final class HTTPExtension extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.HTTPExtension) + HTTPExtensionOrBuilder { + private static final long serialVersionUID = 0L; + // Use HTTPExtension.newBuilder() to construct. + private HTTPExtension(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private HTTPExtension() { + verb_ = 0; + querystring_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new HTTPExtension(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private HTTPExtension( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + verb_ = rawValue; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + querystring_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_HTTPExtension_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_HTTPExtension_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.HTTPExtension.class, spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Builder.class); + } + + /** + * Protobuf enum {@code spec.proto.runtime.v1.HTTPExtension.Verb} + */ + public enum Verb + implements com.google.protobuf.ProtocolMessageEnum { + /** + * NONE = 0; + */ + NONE(0), + /** + * GET = 1; + */ + GET(1), + /** + * HEAD = 2; + */ + HEAD(2), + /** + * POST = 3; + */ + POST(3), + /** + * PUT = 4; + */ + PUT(4), + /** + * DELETE = 5; + */ + DELETE(5), + /** + * CONNECT = 6; + */ + CONNECT(6), + /** + * OPTIONS = 7; + */ + OPTIONS(7), + /** + * TRACE = 8; + */ + TRACE(8), + UNRECOGNIZED(-1), + ; + + /** + * NONE = 0; + */ + public static final int NONE_VALUE = 0; + /** + * GET = 1; + */ + public static final int GET_VALUE = 1; + /** + * HEAD = 2; + */ + public static final int HEAD_VALUE = 2; + /** + * POST = 3; + */ + public static final int POST_VALUE = 3; + /** + * PUT = 4; + */ + public static final int PUT_VALUE = 4; + /** + * DELETE = 5; + */ + public static final int DELETE_VALUE = 5; + /** + * CONNECT = 6; + */ + public static final int CONNECT_VALUE = 6; + /** + * OPTIONS = 7; + */ + public static final int OPTIONS_VALUE = 7; + /** + * TRACE = 8; + */ + public static final int TRACE_VALUE = 8; + + + 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 Verb 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 Verb forNumber(int value) { + switch (value) { + case 0: return NONE; + case 1: return GET; + case 2: return HEAD; + case 3: return POST; + case 4: return PUT; + case 5: return DELETE; + case 6: return CONNECT; + case 7: return OPTIONS; + case 8: return TRACE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Verb> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Verb findValueByNumber(int number) { + return Verb.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 spec.proto.runtime.v1.RuntimeProto.HTTPExtension.getDescriptor().getEnumTypes().get(0); + } + + private static final Verb[] VALUES = values(); + + public static Verb 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 Verb(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:spec.proto.runtime.v1.HTTPExtension.Verb) + } + + public static final int VERB_FIELD_NUMBER = 1; + private int verb_; + /** + * .spec.proto.runtime.v1.HTTPExtension.Verb verb = 1; + * @return The enum numeric value on the wire for verb. + */ + @java.lang.Override public int getVerbValue() { + return verb_; + } + /** + * .spec.proto.runtime.v1.HTTPExtension.Verb verb = 1; + * @return The verb. + */ + @java.lang.Override public spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb getVerb() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb result = spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb.valueOf(verb_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb.UNRECOGNIZED : result; + } + + public static final int QUERYSTRING_FIELD_NUMBER = 2; + private volatile java.lang.Object querystring_; + /** + * string querystring = 2; + * @return The querystring. + */ + @java.lang.Override + public java.lang.String getQuerystring() { + java.lang.Object ref = querystring_; + 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(); + querystring_ = s; + return s; + } + } + /** + * string querystring = 2; + * @return The bytes for querystring. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getQuerystringBytes() { + java.lang.Object ref = querystring_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + querystring_ = 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 (verb_ != spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb.NONE.getNumber()) { + output.writeEnum(1, verb_); + } + if (!getQuerystringBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, querystring_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (verb_ != spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb.NONE.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, verb_); + } + if (!getQuerystringBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, querystring_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.HTTPExtension)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.HTTPExtension other = (spec.proto.runtime.v1.RuntimeProto.HTTPExtension) obj; + + if (verb_ != other.verb_) return false; + if (!getQuerystring() + .equals(other.getQuerystring())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + VERB_FIELD_NUMBER; + hash = (53 * hash) + verb_; + hash = (37 * hash) + QUERYSTRING_FIELD_NUMBER; + hash = (53 * hash) + getQuerystring().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension 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 spec.proto.runtime.v1.RuntimeProto.HTTPExtension parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension 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 spec.proto.runtime.v1.RuntimeProto.HTTPExtension parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension 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(spec.proto.runtime.v1.RuntimeProto.HTTPExtension 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 spec.proto.runtime.v1.HTTPExtension} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.HTTPExtension) + spec.proto.runtime.v1.RuntimeProto.HTTPExtensionOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_HTTPExtension_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_HTTPExtension_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.HTTPExtension.class, spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.HTTPExtension.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + verb_ = 0; + + querystring_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_HTTPExtension_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.HTTPExtension getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.HTTPExtension.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.HTTPExtension build() { + spec.proto.runtime.v1.RuntimeProto.HTTPExtension result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.HTTPExtension buildPartial() { + spec.proto.runtime.v1.RuntimeProto.HTTPExtension result = new spec.proto.runtime.v1.RuntimeProto.HTTPExtension(this); + result.verb_ = verb_; + result.querystring_ = querystring_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.HTTPExtension) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.HTTPExtension)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.HTTPExtension other) { + if (other == spec.proto.runtime.v1.RuntimeProto.HTTPExtension.getDefaultInstance()) return this; + if (other.verb_ != 0) { + setVerbValue(other.getVerbValue()); + } + if (!other.getQuerystring().isEmpty()) { + querystring_ = other.querystring_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.HTTPExtension parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.HTTPExtension) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int verb_ = 0; + /** + * .spec.proto.runtime.v1.HTTPExtension.Verb verb = 1; + * @return The enum numeric value on the wire for verb. + */ + @java.lang.Override public int getVerbValue() { + return verb_; + } + /** + * .spec.proto.runtime.v1.HTTPExtension.Verb verb = 1; + * @param value The enum numeric value on the wire for verb to set. + * @return This builder for chaining. + */ + public Builder setVerbValue(int value) { + + verb_ = value; + onChanged(); + return this; + } + /** + * .spec.proto.runtime.v1.HTTPExtension.Verb verb = 1; + * @return The verb. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb getVerb() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb result = spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb.valueOf(verb_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb.UNRECOGNIZED : result; + } + /** + * .spec.proto.runtime.v1.HTTPExtension.Verb verb = 1; + * @param value The verb to set. + * @return This builder for chaining. + */ + public Builder setVerb(spec.proto.runtime.v1.RuntimeProto.HTTPExtension.Verb value) { + if (value == null) { + throw new NullPointerException(); + } + + verb_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .spec.proto.runtime.v1.HTTPExtension.Verb verb = 1; + * @return This builder for chaining. + */ + public Builder clearVerb() { + + verb_ = 0; + onChanged(); + return this; + } + + private java.lang.Object querystring_ = ""; + /** + * string querystring = 2; + * @return The querystring. + */ + public java.lang.String getQuerystring() { + java.lang.Object ref = querystring_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + querystring_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string querystring = 2; + * @return The bytes for querystring. + */ + public com.google.protobuf.ByteString + getQuerystringBytes() { + java.lang.Object ref = querystring_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + querystring_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string querystring = 2; + * @param value The querystring to set. + * @return This builder for chaining. + */ + public Builder setQuerystring( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + querystring_ = value; + onChanged(); + return this; + } + /** + * string querystring = 2; + * @return This builder for chaining. + */ + public Builder clearQuerystring() { + + querystring_ = getDefaultInstance().getQuerystring(); + onChanged(); + return this; + } + /** + * string querystring = 2; + * @param value The bytes for querystring to set. + * @return This builder for chaining. + */ + public Builder setQuerystringBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + querystring_ = value; + 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:spec.proto.runtime.v1.HTTPExtension) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.HTTPExtension) + private static final spec.proto.runtime.v1.RuntimeProto.HTTPExtension DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.HTTPExtension(); + } + + public static spec.proto.runtime.v1.RuntimeProto.HTTPExtension getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public HTTPExtension parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new HTTPExtension(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.HTTPExtension getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface InvokeResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.InvokeResponse) + com.google.protobuf.MessageOrBuilder { + + /** + * .google.protobuf.Any data = 1; + * @return Whether the data field is set. + */ + boolean hasData(); + /** + * .google.protobuf.Any data = 1; + * @return The data. + */ + com.google.protobuf.Any getData(); + /** + * .google.protobuf.Any data = 1; + */ + com.google.protobuf.AnyOrBuilder getDataOrBuilder(); + + /** + * string content_type = 2; + * @return The contentType. + */ + java.lang.String getContentType(); + /** + * string content_type = 2; + * @return The bytes for contentType. + */ + com.google.protobuf.ByteString + getContentTypeBytes(); + } + /** + * Protobuf type {@code spec.proto.runtime.v1.InvokeResponse} + */ + public static final class InvokeResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.InvokeResponse) + InvokeResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use InvokeResponse.newBuilder() to construct. + private InvokeResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private InvokeResponse() { + contentType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new InvokeResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private InvokeResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.Any.Builder subBuilder = null; + if (data_ != null) { + subBuilder = data_.toBuilder(); + } + data_ = input.readMessage(com.google.protobuf.Any.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(data_); + data_ = subBuilder.buildPartial(); + } + + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + contentType_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.InvokeResponse.class, spec.proto.runtime.v1.RuntimeProto.InvokeResponse.Builder.class); + } + + public static final int DATA_FIELD_NUMBER = 1; + private com.google.protobuf.Any data_; + /** + * .google.protobuf.Any data = 1; + * @return Whether the data field is set. + */ + @java.lang.Override + public boolean hasData() { + return data_ != null; + } + /** + * .google.protobuf.Any data = 1; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.Any getData() { + return data_ == null ? com.google.protobuf.Any.getDefaultInstance() : data_; + } + /** + * .google.protobuf.Any data = 1; + */ + @java.lang.Override + public com.google.protobuf.AnyOrBuilder getDataOrBuilder() { + return getData(); + } + + public static final int CONTENT_TYPE_FIELD_NUMBER = 2; + private volatile java.lang.Object contentType_; + /** + * string content_type = 2; + * @return The contentType. + */ + @java.lang.Override + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + 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(); + contentType_ = s; + return s; + } + } + /** + * string content_type = 2; + * @return The bytes for contentType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contentType_ = 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 (data_ != null) { + output.writeMessage(1, getData()); + } + if (!getContentTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, contentType_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (data_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getData()); + } + if (!getContentTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, contentType_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.InvokeResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.InvokeResponse other = (spec.proto.runtime.v1.RuntimeProto.InvokeResponse) obj; + + if (hasData() != other.hasData()) return false; + if (hasData()) { + if (!getData() + .equals(other.getData())) return false; + } + if (!getContentType() + .equals(other.getContentType())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasData()) { + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + } + hash = (37 * hash) + CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getContentType().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse 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 spec.proto.runtime.v1.RuntimeProto.InvokeResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse 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 spec.proto.runtime.v1.RuntimeProto.InvokeResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse 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(spec.proto.runtime.v1.RuntimeProto.InvokeResponse 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 spec.proto.runtime.v1.InvokeResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.InvokeResponse) + spec.proto.runtime.v1.RuntimeProto.InvokeResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.InvokeResponse.class, spec.proto.runtime.v1.RuntimeProto.InvokeResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.InvokeResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (dataBuilder_ == null) { + data_ = null; + } else { + data_ = null; + dataBuilder_ = null; + } + contentType_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.InvokeResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeResponse build() { + spec.proto.runtime.v1.RuntimeProto.InvokeResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.InvokeResponse result = new spec.proto.runtime.v1.RuntimeProto.InvokeResponse(this); + if (dataBuilder_ == null) { + result.data_ = data_; + } else { + result.data_ = dataBuilder_.build(); + } + result.contentType_ = contentType_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.InvokeResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.InvokeResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.InvokeResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.InvokeResponse.getDefaultInstance()) return this; + if (other.hasData()) { + mergeData(other.getData()); + } + if (!other.getContentType().isEmpty()) { + contentType_ = other.contentType_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.InvokeResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.InvokeResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private com.google.protobuf.Any data_; + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> dataBuilder_; + /** + * .google.protobuf.Any data = 1; + * @return Whether the data field is set. + */ + public boolean hasData() { + return dataBuilder_ != null || data_ != null; + } + /** + * .google.protobuf.Any data = 1; + * @return The data. + */ + public com.google.protobuf.Any getData() { + if (dataBuilder_ == null) { + return data_ == null ? com.google.protobuf.Any.getDefaultInstance() : data_; + } else { + return dataBuilder_.getMessage(); + } + } + /** + * .google.protobuf.Any data = 1; + */ + public Builder setData(com.google.protobuf.Any value) { + if (dataBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + data_ = value; + onChanged(); + } else { + dataBuilder_.setMessage(value); + } + + return this; + } + /** + * .google.protobuf.Any data = 1; + */ + public Builder setData( + com.google.protobuf.Any.Builder builderForValue) { + if (dataBuilder_ == null) { + data_ = builderForValue.build(); + onChanged(); + } else { + dataBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + * .google.protobuf.Any data = 1; + */ + public Builder mergeData(com.google.protobuf.Any value) { + if (dataBuilder_ == null) { + if (data_ != null) { + data_ = + com.google.protobuf.Any.newBuilder(data_).mergeFrom(value).buildPartial(); + } else { + data_ = value; + } + onChanged(); + } else { + dataBuilder_.mergeFrom(value); + } + + return this; + } + /** + * .google.protobuf.Any data = 1; + */ + public Builder clearData() { + if (dataBuilder_ == null) { + data_ = null; + onChanged(); + } else { + data_ = null; + dataBuilder_ = null; + } + + return this; + } + /** + * .google.protobuf.Any data = 1; + */ + public com.google.protobuf.Any.Builder getDataBuilder() { + + onChanged(); + return getDataFieldBuilder().getBuilder(); + } + /** + * .google.protobuf.Any data = 1; + */ + public com.google.protobuf.AnyOrBuilder getDataOrBuilder() { + if (dataBuilder_ != null) { + return dataBuilder_.getMessageOrBuilder(); + } else { + return data_ == null ? + com.google.protobuf.Any.getDefaultInstance() : data_; + } + } + /** + * .google.protobuf.Any data = 1; + */ + private com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder> + getDataFieldBuilder() { + if (dataBuilder_ == null) { + dataBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + com.google.protobuf.Any, com.google.protobuf.Any.Builder, com.google.protobuf.AnyOrBuilder>( + getData(), + getParentForChildren(), + isClean()); + data_ = null; + } + return dataBuilder_; + } + + private java.lang.Object contentType_ = ""; + /** + * string content_type = 2; + * @return The contentType. + */ + public java.lang.String getContentType() { + java.lang.Object ref = contentType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + contentType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string content_type = 2; + * @return The bytes for contentType. + */ + public com.google.protobuf.ByteString + getContentTypeBytes() { + java.lang.Object ref = contentType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + contentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string content_type = 2; + * @param value The contentType to set. + * @return This builder for chaining. + */ + public Builder setContentType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + contentType_ = value; + onChanged(); + return this; + } + /** + * string content_type = 2; + * @return This builder for chaining. + */ + public Builder clearContentType() { + + contentType_ = getDefaultInstance().getContentType(); + onChanged(); + return this; + } + /** + * string content_type = 2; + * @param value The bytes for contentType to set. + * @return This builder for chaining. + */ + public Builder setContentTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + contentType_ = value; + 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:spec.proto.runtime.v1.InvokeResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.InvokeResponse) + private static final spec.proto.runtime.v1.RuntimeProto.InvokeResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.InvokeResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.InvokeResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InvokeResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InvokeResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ConfigurationItemOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.ConfigurationItem) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. The key of configuration item
+     * 
+ * + * string key = 1; + * @return The key. + */ + java.lang.String getKey(); + /** + *
+     * Required. The key of configuration item
+     * 
+ * + * string key = 1; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + *
+     * The content of configuration item
+     * Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set.
+     * 
+ * + * string content = 2; + * @return The content. + */ + java.lang.String getContent(); + /** + *
+     * The content of configuration item
+     * Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set.
+     * 
+ * + * string content = 2; + * @return The bytes for content. + */ + com.google.protobuf.ByteString + getContentBytes(); + + /** + *
+     * The group of configuration item.
+     * 
+ * + * string group = 3; + * @return The group. + */ + java.lang.String getGroup(); + /** + *
+     * The group of configuration item.
+     * 
+ * + * string group = 3; + * @return The bytes for group. + */ + com.google.protobuf.ByteString + getGroupBytes(); + + /** + *
+     * The label of configuration item.
+     * 
+ * + * string label = 4; + * @return The label. + */ + java.lang.String getLabel(); + /** + *
+     * The label of configuration item.
+     * 
+ * + * string label = 4; + * @return The bytes for label. + */ + com.google.protobuf.ByteString + getLabelBytes(); + + /** + *
+     * The tag list of configuration item.
+     * 
+ * + * map<string, string> tags = 5; + */ + int getTagsCount(); + /** + *
+     * The tag list of configuration item.
+     * 
+ * + * map<string, string> tags = 5; + */ + boolean containsTags( + java.lang.String key); + /** + * Use {@link #getTagsMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getTags(); + /** + *
+     * The tag list of configuration item.
+     * 
+ * + * map<string, string> tags = 5; + */ + java.util.Map + getTagsMap(); + /** + *
+     * The tag list of configuration item.
+     * 
+ * + * map<string, string> tags = 5; + */ + + java.lang.String getTagsOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The tag list of configuration item.
+     * 
+ * + * map<string, string> tags = 5; + */ + + java.lang.String getTagsOrThrow( + java.lang.String key); + + /** + *
+     * The metadata which will be passed to configuration store component.
+     * 
+ * + * map<string, string> metadata = 6; + */ + int getMetadataCount(); + /** + *
+     * The metadata which will be passed to configuration store component.
+     * 
+ * + * map<string, string> metadata = 6; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata which will be passed to configuration store component.
+     * 
+ * + * map<string, string> metadata = 6; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata which will be passed to configuration store component.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata which will be passed to configuration store component.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * ConfigurationItem represents a configuration item with key, content and other information.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.ConfigurationItem} + */ + public static final class ConfigurationItem extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.ConfigurationItem) + ConfigurationItemOrBuilder { + private static final long serialVersionUID = 0L; + // Use ConfigurationItem.newBuilder() to construct. + private ConfigurationItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ConfigurationItem() { + key_ = ""; + content_ = ""; + group_ = ""; + label_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ConfigurationItem(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ConfigurationItem( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + content_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + group_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + label_ = s; + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + tags_ = com.google.protobuf.MapField.newMapField( + TagsDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + tags__ = input.readMessage( + TagsDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + tags_.getMutableMap().put( + tags__.getKey(), tags__.getValue()); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ConfigurationItem_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetTags(); + case 6: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ConfigurationItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.class, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + *
+     * Required. The key of configuration item
+     * 
+ * + * string key = 1; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + *
+     * Required. The key of configuration item
+     * 
+ * + * string key = 1; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONTENT_FIELD_NUMBER = 2; + private volatile java.lang.Object content_; + /** + *
+     * The content of configuration item
+     * Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set.
+     * 
+ * + * string content = 2; + * @return The content. + */ + @java.lang.Override + public java.lang.String getContent() { + java.lang.Object ref = content_; + 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(); + content_ = s; + return s; + } + } + /** + *
+     * The content of configuration item
+     * Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set.
+     * 
+ * + * string content = 2; + * @return The bytes for content. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_FIELD_NUMBER = 3; + private volatile java.lang.Object group_; + /** + *
+     * The group of configuration item.
+     * 
+ * + * string group = 3; + * @return The group. + */ + @java.lang.Override + public java.lang.String getGroup() { + java.lang.Object ref = group_; + 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(); + group_ = s; + return s; + } + } + /** + *
+     * The group of configuration item.
+     * 
+ * + * string group = 3; + * @return The bytes for group. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGroupBytes() { + java.lang.Object ref = group_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + group_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABEL_FIELD_NUMBER = 4; + private volatile java.lang.Object label_; + /** + *
+     * The label of configuration item.
+     * 
+ * + * string label = 4; + * @return The label. + */ + @java.lang.Override + public java.lang.String getLabel() { + java.lang.Object ref = label_; + 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(); + label_ = s; + return s; + } + } + /** + *
+     * The label of configuration item.
+     * 
+ * + * string label = 4; + * @return The bytes for label. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TAGS_FIELD_NUMBER = 5; + private static final class TagsDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ConfigurationItem_TagsEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> tags_; + private com.google.protobuf.MapField + internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + /** + *
+     * The tag list of configuration item.
+     * 
+ * + * map<string, string> tags = 5; + */ + + @java.lang.Override + public boolean containsTags( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetTags().getMap().containsKey(key); + } + /** + * Use {@link #getTagsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + /** + *
+     * The tag list of configuration item.
+     * 
+ * + * map<string, string> tags = 5; + */ + @java.lang.Override + + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + /** + *
+     * The tag list of configuration item.
+     * 
+ * + * map<string, string> tags = 5; + */ + @java.lang.Override + + public java.lang.String getTagsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The tag list of configuration item.
+     * 
+ * + * map<string, string> tags = 5; + */ + @java.lang.Override + + public java.lang.String getTagsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int METADATA_FIELD_NUMBER = 6; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ConfigurationItem_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata which will be passed to configuration store component.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata which will be passed to configuration store component.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata which will be passed to configuration store component.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata which will be passed to configuration store component.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!getContentBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, content_); + } + if (!getGroupBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, group_); + } + if (!getLabelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, label_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetTags(), + TagsDefaultEntryHolder.defaultEntry, + 5); + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 6); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!getContentBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, content_); + } + if (!getGroupBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, group_); + } + if (!getLabelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, label_); + } + for (java.util.Map.Entry entry + : internalGetTags().getMap().entrySet()) { + com.google.protobuf.MapEntry + tags__ = TagsDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, tags__); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.ConfigurationItem)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem other = (spec.proto.runtime.v1.RuntimeProto.ConfigurationItem) obj; + + if (!getKey() + .equals(other.getKey())) return false; + if (!getContent() + .equals(other.getContent())) return false; + if (!getGroup() + .equals(other.getGroup())) return false; + if (!getLabel() + .equals(other.getLabel())) return false; + if (!internalGetTags().equals( + other.internalGetTags())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + CONTENT_FIELD_NUMBER; + hash = (53 * hash) + getContent().hashCode(); + hash = (37 * hash) + GROUP_FIELD_NUMBER; + hash = (53 * hash) + getGroup().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + if (!internalGetTags().getMap().isEmpty()) { + hash = (37 * hash) + TAGS_FIELD_NUMBER; + hash = (53 * hash) + internalGetTags().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem 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 spec.proto.runtime.v1.RuntimeProto.ConfigurationItem parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem 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 spec.proto.runtime.v1.RuntimeProto.ConfigurationItem parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem 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(spec.proto.runtime.v1.RuntimeProto.ConfigurationItem 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; + } + /** + *
+     * ConfigurationItem represents a configuration item with key, content and other information.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.ConfigurationItem} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.ConfigurationItem) + spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ConfigurationItem_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetTags(); + case 6: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableTags(); + case 6: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ConfigurationItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.class, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + content_ = ""; + + group_ = ""; + + label_ = ""; + + internalGetMutableTags().clear(); + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ConfigurationItem_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem build() { + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem buildPartial() { + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem result = new spec.proto.runtime.v1.RuntimeProto.ConfigurationItem(this); + int from_bitField0_ = bitField0_; + result.key_ = key_; + result.content_ = content_; + result.group_ = group_; + result.label_ = label_; + result.tags_ = internalGetTags(); + result.tags_.makeImmutable(); + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.ConfigurationItem) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.ConfigurationItem)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.ConfigurationItem other) { + if (other == spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (!other.getContent().isEmpty()) { + content_ = other.content_; + onChanged(); + } + if (!other.getGroup().isEmpty()) { + group_ = other.group_; + onChanged(); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + onChanged(); + } + internalGetMutableTags().mergeFrom( + other.internalGetTags()); + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.ConfigurationItem) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + *
+       * Required. The key of configuration item
+       * 
+ * + * string key = 1; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The key of configuration item
+       * 
+ * + * string key = 1; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The key of configuration item
+       * 
+ * + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The key of configuration item
+       * 
+ * + * string key = 1; + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + *
+       * Required. The key of configuration item
+       * 
+ * + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private java.lang.Object content_ = ""; + /** + *
+       * The content of configuration item
+       * Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set.
+       * 
+ * + * string content = 2; + * @return The content. + */ + public java.lang.String getContent() { + java.lang.Object ref = content_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + content_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The content of configuration item
+       * Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set.
+       * 
+ * + * string content = 2; + * @return The bytes for content. + */ + public com.google.protobuf.ByteString + getContentBytes() { + java.lang.Object ref = content_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + content_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The content of configuration item
+       * Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set.
+       * 
+ * + * string content = 2; + * @param value The content to set. + * @return This builder for chaining. + */ + public Builder setContent( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + content_ = value; + onChanged(); + return this; + } + /** + *
+       * The content of configuration item
+       * Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set.
+       * 
+ * + * string content = 2; + * @return This builder for chaining. + */ + public Builder clearContent() { + + content_ = getDefaultInstance().getContent(); + onChanged(); + return this; + } + /** + *
+       * The content of configuration item
+       * Empty if the configuration is not set, including the case that the configuration is changed from value-set to value-not-set.
+       * 
+ * + * string content = 2; + * @param value The bytes for content to set. + * @return This builder for chaining. + */ + public Builder setContentBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + content_ = value; + onChanged(); + return this; + } + + private java.lang.Object group_ = ""; + /** + *
+       * The group of configuration item.
+       * 
+ * + * string group = 3; + * @return The group. + */ + public java.lang.String getGroup() { + java.lang.Object ref = group_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + group_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The group of configuration item.
+       * 
+ * + * string group = 3; + * @return The bytes for group. + */ + public com.google.protobuf.ByteString + getGroupBytes() { + java.lang.Object ref = group_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + group_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The group of configuration item.
+       * 
+ * + * string group = 3; + * @param value The group to set. + * @return This builder for chaining. + */ + public Builder setGroup( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + group_ = value; + onChanged(); + return this; + } + /** + *
+       * The group of configuration item.
+       * 
+ * + * string group = 3; + * @return This builder for chaining. + */ + public Builder clearGroup() { + + group_ = getDefaultInstance().getGroup(); + onChanged(); + return this; + } + /** + *
+       * The group of configuration item.
+       * 
+ * + * string group = 3; + * @param value The bytes for group to set. + * @return This builder for chaining. + */ + public Builder setGroupBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + group_ = value; + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + *
+       * The label of configuration item.
+       * 
+ * + * string label = 4; + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The label of configuration item.
+       * 
+ * + * string label = 4; + * @return The bytes for label. + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The label of configuration item.
+       * 
+ * + * string label = 4; + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + label_ = value; + onChanged(); + return this; + } + /** + *
+       * The label of configuration item.
+       * 
+ * + * string label = 4; + * @return This builder for chaining. + */ + public Builder clearLabel() { + + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + /** + *
+       * The label of configuration item.
+       * 
+ * + * string label = 4; + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + label_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> tags_; + private com.google.protobuf.MapField + internalGetTags() { + if (tags_ == null) { + return com.google.protobuf.MapField.emptyMapField( + TagsDefaultEntryHolder.defaultEntry); + } + return tags_; + } + private com.google.protobuf.MapField + internalGetMutableTags() { + onChanged();; + if (tags_ == null) { + tags_ = com.google.protobuf.MapField.newMapField( + TagsDefaultEntryHolder.defaultEntry); + } + if (!tags_.isMutable()) { + tags_ = tags_.copy(); + } + return tags_; + } + + public int getTagsCount() { + return internalGetTags().getMap().size(); + } + /** + *
+       * The tag list of configuration item.
+       * 
+ * + * map<string, string> tags = 5; + */ + + @java.lang.Override + public boolean containsTags( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetTags().getMap().containsKey(key); + } + /** + * Use {@link #getTagsMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getTags() { + return getTagsMap(); + } + /** + *
+       * The tag list of configuration item.
+       * 
+ * + * map<string, string> tags = 5; + */ + @java.lang.Override + + public java.util.Map getTagsMap() { + return internalGetTags().getMap(); + } + /** + *
+       * The tag list of configuration item.
+       * 
+ * + * map<string, string> tags = 5; + */ + @java.lang.Override + + public java.lang.String getTagsOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetTags().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The tag list of configuration item.
+       * 
+ * + * map<string, string> tags = 5; + */ + @java.lang.Override + + public java.lang.String getTagsOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetTags().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearTags() { + internalGetMutableTags().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The tag list of configuration item.
+       * 
+ * + * map<string, string> tags = 5; + */ + + public Builder removeTags( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableTags().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableTags() { + return internalGetMutableTags().getMutableMap(); + } + /** + *
+       * The tag list of configuration item.
+       * 
+ * + * map<string, string> tags = 5; + */ + public Builder putTags( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableTags().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The tag list of configuration item.
+       * 
+ * + * map<string, string> tags = 5; + */ + + public Builder putAllTags( + java.util.Map values) { + internalGetMutableTags().getMutableMap() + .putAll(values); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata which will be passed to configuration store component.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata which will be passed to configuration store component.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata which will be passed to configuration store component.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata which will be passed to configuration store component.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata which will be passed to configuration store component.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata which will be passed to configuration store component.
+       * 
+ * + * map<string, string> metadata = 6; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata which will be passed to configuration store component.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.ConfigurationItem) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.ConfigurationItem) + private static final spec.proto.runtime.v1.RuntimeProto.ConfigurationItem DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.ConfigurationItem(); + } + + public static spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ConfigurationItem parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ConfigurationItem(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetConfigurationRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetConfigurationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * The application id which
+     * Only used for admin, Ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The appId. + */ + java.lang.String getAppId(); + /** + *
+     * The application id which
+     * Only used for admin, Ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + com.google.protobuf.ByteString + getAppIdBytes(); + + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The group. + */ + java.lang.String getGroup(); + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The bytes for group. + */ + com.google.protobuf.ByteString + getGroupBytes(); + + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The label. + */ + java.lang.String getLabel(); + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The bytes for label. + */ + com.google.protobuf.ByteString + getLabelBytes(); + + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return A list containing the keys. + */ + java.util.List + getKeysList(); + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return The count of keys. + */ + int getKeysCount(); + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + java.lang.String getKeys(int index); + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + com.google.protobuf.ByteString + getKeysBytes(int index); + + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + int getMetadataCount(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + + /** + *
+     * Subscribes update event for given keys.
+     * If true, when any configuration item in this request is updated, app will receive event by OnConfigurationEvent() of app callback
+     * 
+ * + * bool subscribe_update = 7; + * @return The subscribeUpdate. + */ + boolean getSubscribeUpdate(); + } + /** + *
+   * GetConfigurationRequest is the message to get a list of key-value configuration from specified configuration store.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetConfigurationRequest} + */ + public static final class GetConfigurationRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetConfigurationRequest) + GetConfigurationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetConfigurationRequest.newBuilder() to construct. + private GetConfigurationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetConfigurationRequest() { + storeName_ = ""; + appId_ = ""; + group_ = ""; + label_ = ""; + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetConfigurationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetConfigurationRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + appId_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + group_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + label_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + keys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + keys_.add(s); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + case 56: { + + subscribeUpdate_ = input.readBool(); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + keys_ = keys_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 6: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest.class, spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object appId_; + /** + *
+     * The application id which
+     * Only used for admin, Ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The appId. + */ + @java.lang.Override + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } + } + /** + *
+     * The application id which
+     * Only used for admin, Ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_FIELD_NUMBER = 3; + private volatile java.lang.Object group_; + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The group. + */ + @java.lang.Override + public java.lang.String getGroup() { + java.lang.Object ref = group_; + 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(); + group_ = s; + return s; + } + } + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The bytes for group. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGroupBytes() { + java.lang.Object ref = group_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + group_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABEL_FIELD_NUMBER = 4; + private volatile java.lang.Object label_; + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The label. + */ + @java.lang.Override + public java.lang.String getLabel() { + java.lang.Object ref = label_; + 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(); + label_ = s; + return s; + } + } + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The bytes for label. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEYS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList keys_; + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return A list containing the keys. + */ + public com.google.protobuf.ProtocolStringList + getKeysList() { + return keys_; + } + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return The count of keys. + */ + public int getKeysCount() { + return keys_.size(); + } + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + public java.lang.String getKeys(int index) { + return keys_.get(index); + } + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + public com.google.protobuf.ByteString + getKeysBytes(int index) { + return keys_.getByteString(index); + } + + public static final int METADATA_FIELD_NUMBER = 6; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int SUBSCRIBE_UPDATE_FIELD_NUMBER = 7; + private boolean subscribeUpdate_; + /** + *
+     * Subscribes update event for given keys.
+     * If true, when any configuration item in this request is updated, app will receive event by OnConfigurationEvent() of app callback
+     * 
+ * + * bool subscribe_update = 7; + * @return The subscribeUpdate. + */ + @java.lang.Override + public boolean getSubscribeUpdate() { + return subscribeUpdate_; + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getAppIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appId_); + } + if (!getGroupBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, group_); + } + if (!getLabelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, label_); + } + for (int i = 0; i < keys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, keys_.getRaw(i)); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 6); + if (subscribeUpdate_ != false) { + output.writeBool(7, subscribeUpdate_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getAppIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appId_); + } + if (!getGroupBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, group_); + } + if (!getLabelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, label_); + } + { + int dataSize = 0; + for (int i = 0; i < keys_.size(); i++) { + dataSize += computeStringSizeNoTag(keys_.getRaw(i)); + } + size += dataSize; + size += 1 * getKeysList().size(); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, metadata__); + } + if (subscribeUpdate_ != false) { + size += com.google.protobuf.CodedOutputStream + .computeBoolSize(7, subscribeUpdate_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest other = (spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getAppId() + .equals(other.getAppId())) return false; + if (!getGroup() + .equals(other.getGroup())) return false; + if (!getLabel() + .equals(other.getLabel())) return false; + if (!getKeysList() + .equals(other.getKeysList())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (getSubscribeUpdate() + != other.getSubscribeUpdate()) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + APP_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppId().hashCode(); + hash = (37 * hash) + GROUP_FIELD_NUMBER; + hash = (53 * hash) + getGroup().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + if (getKeysCount() > 0) { + hash = (37 * hash) + KEYS_FIELD_NUMBER; + hash = (53 * hash) + getKeysList().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (37 * hash) + SUBSCRIBE_UPDATE_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSubscribeUpdate()); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest 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 spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest 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 spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest 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(spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest 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; + } + /** + *
+     * GetConfigurationRequest is the message to get a list of key-value configuration from specified configuration store.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetConfigurationRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetConfigurationRequest) + spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 6: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 6: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest.class, spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + appId_ = ""; + + group_ = ""; + + label_ = ""; + + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableMetadata().clear(); + subscribeUpdate_ = false; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest build() { + spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest result = new spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.appId_ = appId_; + result.group_ = group_; + result.label_ = label_; + if (((bitField0_ & 0x00000001) != 0)) { + keys_ = keys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.keys_ = keys_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + result.subscribeUpdate_ = subscribeUpdate_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getAppId().isEmpty()) { + appId_ = other.appId_; + onChanged(); + } + if (!other.getGroup().isEmpty()) { + group_ = other.group_; + onChanged(); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + onChanged(); + } + if (!other.keys_.isEmpty()) { + if (keys_.isEmpty()) { + keys_ = other.keys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKeysIsMutable(); + keys_.addAll(other.keys_); + } + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + if (other.getSubscribeUpdate() != false) { + setSubscribeUpdate(other.getSubscribeUpdate()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object appId_ = ""; + /** + *
+       * The application id which
+       * Only used for admin, Ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return The appId. + */ + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The application id which
+       * Only used for admin, Ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The application id which
+       * Only used for admin, Ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @param value The appId to set. + * @return This builder for chaining. + */ + public Builder setAppId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appId_ = value; + onChanged(); + return this; + } + /** + *
+       * The application id which
+       * Only used for admin, Ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return This builder for chaining. + */ + public Builder clearAppId() { + + appId_ = getDefaultInstance().getAppId(); + onChanged(); + return this; + } + /** + *
+       * The application id which
+       * Only used for admin, Ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @param value The bytes for appId to set. + * @return This builder for chaining. + */ + public Builder setAppIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appId_ = value; + onChanged(); + return this; + } + + private java.lang.Object group_ = ""; + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @return The group. + */ + public java.lang.String getGroup() { + java.lang.Object ref = group_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + group_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @return The bytes for group. + */ + public com.google.protobuf.ByteString + getGroupBytes() { + java.lang.Object ref = group_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + group_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @param value The group to set. + * @return This builder for chaining. + */ + public Builder setGroup( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + group_ = value; + onChanged(); + return this; + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @return This builder for chaining. + */ + public Builder clearGroup() { + + group_ = getDefaultInstance().getGroup(); + onChanged(); + return this; + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @param value The bytes for group to set. + * @return This builder for chaining. + */ + public Builder setGroupBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + group_ = value; + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @return The bytes for label. + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + label_ = value; + onChanged(); + return this; + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @return This builder for chaining. + */ + public Builder clearLabel() { + + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + label_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + keys_ = new com.google.protobuf.LazyStringArrayList(keys_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @return A list containing the keys. + */ + public com.google.protobuf.ProtocolStringList + getKeysList() { + return keys_.getUnmodifiableView(); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @return The count of keys. + */ + public int getKeysCount() { + return keys_.size(); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + public java.lang.String getKeys(int index) { + return keys_.get(index); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + public com.google.protobuf.ByteString + getKeysBytes(int index) { + return keys_.getByteString(index); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param index The index to set the value at. + * @param value The keys to set. + * @return This builder for chaining. + */ + public Builder setKeys( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param value The keys to add. + * @return This builder for chaining. + */ + public Builder addKeys( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.add(value); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param values The keys to add. + * @return This builder for chaining. + */ + public Builder addAllKeys( + java.lang.Iterable values) { + ensureKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, keys_); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @return This builder for chaining. + */ + public Builder clearKeys() { + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param value The bytes of the keys to add. + * @return This builder for chaining. + */ + public Builder addKeysBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureKeysIsMutable(); + keys_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + return this; + } + + private boolean subscribeUpdate_ ; + /** + *
+       * Subscribes update event for given keys.
+       * If true, when any configuration item in this request is updated, app will receive event by OnConfigurationEvent() of app callback
+       * 
+ * + * bool subscribe_update = 7; + * @return The subscribeUpdate. + */ + @java.lang.Override + public boolean getSubscribeUpdate() { + return subscribeUpdate_; + } + /** + *
+       * Subscribes update event for given keys.
+       * If true, when any configuration item in this request is updated, app will receive event by OnConfigurationEvent() of app callback
+       * 
+ * + * bool subscribe_update = 7; + * @param value The subscribeUpdate to set. + * @return This builder for chaining. + */ + public Builder setSubscribeUpdate(boolean value) { + + subscribeUpdate_ = value; + onChanged(); + return this; + } + /** + *
+       * Subscribes update event for given keys.
+       * If true, when any configuration item in this request is updated, app will receive event by OnConfigurationEvent() of app callback
+       * 
+ * + * bool subscribe_update = 7; + * @return This builder for chaining. + */ + public Builder clearSubscribeUpdate() { + + subscribeUpdate_ = false; + 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:spec.proto.runtime.v1.GetConfigurationRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetConfigurationRequest) + private static final spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConfigurationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetConfigurationRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetConfigurationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetConfigurationResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetConfigurationResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + java.util.List + getItemsList(); + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getItems(int index); + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + int getItemsCount(); + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + java.util.List + getItemsOrBuilderList(); + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder getItemsOrBuilder( + int index); + } + /** + *
+   * GetConfigurationResponse is the response conveying the list of configuration values.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetConfigurationResponse} + */ + public static final class GetConfigurationResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetConfigurationResponse) + GetConfigurationResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetConfigurationResponse.newBuilder() to construct. + private GetConfigurationResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetConfigurationResponse() { + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetConfigurationResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetConfigurationResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + items_.add( + input.readMessage(spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse.class, spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse.Builder.class); + } + + public static final int ITEMS_FIELD_NUMBER = 1; + private java.util.List items_; + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getItems(int index) { + return items_.get(index); + } + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder getItemsOrBuilder( + int index) { + return items_.get(index); + } + + 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 < items_.size(); i++) { + output.writeMessage(1, items_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, items_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse other = (spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse) obj; + + if (!getItemsList() + .equals(other.getItemsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse 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 spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse 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 spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse 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(spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse 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; + } + /** + *
+     * GetConfigurationResponse is the response conveying the list of configuration values.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetConfigurationResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetConfigurationResponse) + spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse.class, spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getItemsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + itemsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetConfigurationResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse build() { + spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse result = new spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse(this); + int from_bitField0_ = bitField0_; + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse.getDefaultInstance()) return this; + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getItemsFieldBuilder() : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List items_ = + java.util.Collections.emptyList(); + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder, spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder> itemsBuilder_; + + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public Builder setItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public Builder setItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public Builder addItems(spec.proto.runtime.v1.RuntimeProto.ConfigurationItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public Builder addItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public Builder addItems( + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public Builder addItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder getItemsBuilder( + int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder getItemsOrBuilder( + int index) { + if (itemsBuilder_ == null) { + return items_.get(index); } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder addItemsBuilder() { + return getItemsFieldBuilder().addBuilder( + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.getDefaultInstance()); + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder addItemsBuilder( + int index) { + return getItemsFieldBuilder().addBuilder( + index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.getDefaultInstance()); + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 1; + */ + public java.util.List + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder, spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder, spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder>( + items_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + items_ = null; + } + return itemsBuilder_; + } + @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:spec.proto.runtime.v1.GetConfigurationResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetConfigurationResponse) + private static final spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetConfigurationResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetConfigurationResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetConfigurationResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubscribeConfigurationRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.SubscribeConfigurationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * The application id which
+     * Only used for admin, ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The appId. + */ + java.lang.String getAppId(); + /** + *
+     * The application id which
+     * Only used for admin, ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + com.google.protobuf.ByteString + getAppIdBytes(); + + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The group. + */ + java.lang.String getGroup(); + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The bytes for group. + */ + com.google.protobuf.ByteString + getGroupBytes(); + + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The label. + */ + java.lang.String getLabel(); + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The bytes for label. + */ + com.google.protobuf.ByteString + getLabelBytes(); + + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return A list containing the keys. + */ + java.util.List + getKeysList(); + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return The count of keys. + */ + int getKeysCount(); + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + java.lang.String getKeys(int index); + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + com.google.protobuf.ByteString + getKeysBytes(int index); + + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + int getMetadataCount(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * SubscribeConfigurationRequest is the message to get a list of key-value configuration from specified configuration store.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.SubscribeConfigurationRequest} + */ + public static final class SubscribeConfigurationRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.SubscribeConfigurationRequest) + SubscribeConfigurationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubscribeConfigurationRequest.newBuilder() to construct. + private SubscribeConfigurationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SubscribeConfigurationRequest() { + storeName_ = ""; + appId_ = ""; + group_ = ""; + label_ = ""; + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SubscribeConfigurationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SubscribeConfigurationRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + appId_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + group_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + label_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + keys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + keys_.add(s); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + keys_ = keys_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 6: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest.class, spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object appId_; + /** + *
+     * The application id which
+     * Only used for admin, ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The appId. + */ + @java.lang.Override + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } + } + /** + *
+     * The application id which
+     * Only used for admin, ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_FIELD_NUMBER = 3; + private volatile java.lang.Object group_; + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The group. + */ + @java.lang.Override + public java.lang.String getGroup() { + java.lang.Object ref = group_; + 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(); + group_ = s; + return s; + } + } + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The bytes for group. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGroupBytes() { + java.lang.Object ref = group_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + group_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABEL_FIELD_NUMBER = 4; + private volatile java.lang.Object label_; + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The label. + */ + @java.lang.Override + public java.lang.String getLabel() { + java.lang.Object ref = label_; + 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(); + label_ = s; + return s; + } + } + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The bytes for label. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEYS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList keys_; + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return A list containing the keys. + */ + public com.google.protobuf.ProtocolStringList + getKeysList() { + return keys_; + } + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return The count of keys. + */ + public int getKeysCount() { + return keys_.size(); + } + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + public java.lang.String getKeys(int index) { + return keys_.get(index); + } + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + public com.google.protobuf.ByteString + getKeysBytes(int index) { + return keys_.getByteString(index); + } + + public static final int METADATA_FIELD_NUMBER = 6; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getAppIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appId_); + } + if (!getGroupBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, group_); + } + if (!getLabelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, label_); + } + for (int i = 0; i < keys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, keys_.getRaw(i)); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 6); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getAppIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appId_); + } + if (!getGroupBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, group_); + } + if (!getLabelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, label_); + } + { + int dataSize = 0; + for (int i = 0; i < keys_.size(); i++) { + dataSize += computeStringSizeNoTag(keys_.getRaw(i)); + } + size += dataSize; + size += 1 * getKeysList().size(); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest other = (spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getAppId() + .equals(other.getAppId())) return false; + if (!getGroup() + .equals(other.getGroup())) return false; + if (!getLabel() + .equals(other.getLabel())) return false; + if (!getKeysList() + .equals(other.getKeysList())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + APP_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppId().hashCode(); + hash = (37 * hash) + GROUP_FIELD_NUMBER; + hash = (53 * hash) + getGroup().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + if (getKeysCount() > 0) { + hash = (37 * hash) + KEYS_FIELD_NUMBER; + hash = (53 * hash) + getKeysList().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest 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 spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest 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 spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest 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(spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest 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; + } + /** + *
+     * SubscribeConfigurationRequest is the message to get a list of key-value configuration from specified configuration store.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.SubscribeConfigurationRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.SubscribeConfigurationRequest) + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 6: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 6: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest.class, spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + appId_ = ""; + + group_ = ""; + + label_ = ""; + + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest build() { + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest result = new spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.appId_ = appId_; + result.group_ = group_; + result.label_ = label_; + if (((bitField0_ & 0x00000001) != 0)) { + keys_ = keys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.keys_ = keys_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getAppId().isEmpty()) { + appId_ = other.appId_; + onChanged(); + } + if (!other.getGroup().isEmpty()) { + group_ = other.group_; + onChanged(); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + onChanged(); + } + if (!other.keys_.isEmpty()) { + if (keys_.isEmpty()) { + keys_ = other.keys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKeysIsMutable(); + keys_.addAll(other.keys_); + } + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object appId_ = ""; + /** + *
+       * The application id which
+       * Only used for admin, ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return The appId. + */ + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The application id which
+       * Only used for admin, ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The application id which
+       * Only used for admin, ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @param value The appId to set. + * @return This builder for chaining. + */ + public Builder setAppId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appId_ = value; + onChanged(); + return this; + } + /** + *
+       * The application id which
+       * Only used for admin, ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return This builder for chaining. + */ + public Builder clearAppId() { + + appId_ = getDefaultInstance().getAppId(); + onChanged(); + return this; + } + /** + *
+       * The application id which
+       * Only used for admin, ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @param value The bytes for appId to set. + * @return This builder for chaining. + */ + public Builder setAppIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appId_ = value; + onChanged(); + return this; + } + + private java.lang.Object group_ = ""; + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @return The group. + */ + public java.lang.String getGroup() { + java.lang.Object ref = group_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + group_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @return The bytes for group. + */ + public com.google.protobuf.ByteString + getGroupBytes() { + java.lang.Object ref = group_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + group_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @param value The group to set. + * @return This builder for chaining. + */ + public Builder setGroup( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + group_ = value; + onChanged(); + return this; + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @return This builder for chaining. + */ + public Builder clearGroup() { + + group_ = getDefaultInstance().getGroup(); + onChanged(); + return this; + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @param value The bytes for group to set. + * @return This builder for chaining. + */ + public Builder setGroupBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + group_ = value; + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @return The bytes for label. + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + label_ = value; + onChanged(); + return this; + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @return This builder for chaining. + */ + public Builder clearLabel() { + + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + label_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + keys_ = new com.google.protobuf.LazyStringArrayList(keys_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @return A list containing the keys. + */ + public com.google.protobuf.ProtocolStringList + getKeysList() { + return keys_.getUnmodifiableView(); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @return The count of keys. + */ + public int getKeysCount() { + return keys_.size(); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + public java.lang.String getKeys(int index) { + return keys_.get(index); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + public com.google.protobuf.ByteString + getKeysBytes(int index) { + return keys_.getByteString(index); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param index The index to set the value at. + * @param value The keys to set. + * @return This builder for chaining. + */ + public Builder setKeys( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param value The keys to add. + * @return This builder for chaining. + */ + public Builder addKeys( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.add(value); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param values The keys to add. + * @return This builder for chaining. + */ + public Builder addAllKeys( + java.lang.Iterable values) { + ensureKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, keys_); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @return This builder for chaining. + */ + public Builder clearKeys() { + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param value The bytes of the keys to add. + * @return This builder for chaining. + */ + public Builder addKeysBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureKeysIsMutable(); + keys_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.SubscribeConfigurationRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.SubscribeConfigurationRequest) + private static final spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubscribeConfigurationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SubscribeConfigurationRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SubscribeConfigurationResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.SubscribeConfigurationResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * The application id.
+     * Only used for admin client.
+     * 
+ * + * string app_id = 2; + * @return The appId. + */ + java.lang.String getAppId(); + /** + *
+     * The application id.
+     * Only used for admin client.
+     * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + com.google.protobuf.ByteString + getAppIdBytes(); + + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + java.util.List + getItemsList(); + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getItems(int index); + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + int getItemsCount(); + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + java.util.List + getItemsOrBuilderList(); + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder getItemsOrBuilder( + int index); + } + /** + *
+   * SubscribeConfigurationResponse is the response conveying the list of configuration values.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.SubscribeConfigurationResponse} + */ + public static final class SubscribeConfigurationResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.SubscribeConfigurationResponse) + SubscribeConfigurationResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use SubscribeConfigurationResponse.newBuilder() to construct. + private SubscribeConfigurationResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SubscribeConfigurationResponse() { + storeName_ = ""; + appId_ = ""; + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SubscribeConfigurationResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SubscribeConfigurationResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + appId_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + items_.add( + input.readMessage(spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse.class, spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object appId_; + /** + *
+     * The application id.
+     * Only used for admin client.
+     * 
+ * + * string app_id = 2; + * @return The appId. + */ + @java.lang.Override + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } + } + /** + *
+     * The application id.
+     * Only used for admin client.
+     * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 3; + private java.util.List items_; + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getItems(int index) { + return items_.get(index); + } + /** + *
+     * The list of items containing configuration values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder getItemsOrBuilder( + int index) { + return items_.get(index); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getAppIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appId_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(3, items_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getAppIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appId_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, items_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse other = (spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getAppId() + .equals(other.getAppId())) return false; + if (!getItemsList() + .equals(other.getItemsList())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + APP_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppId().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse 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 spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse 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 spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse 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(spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse 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; + } + /** + *
+     * SubscribeConfigurationResponse is the response conveying the list of configuration values.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.SubscribeConfigurationResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.SubscribeConfigurationResponse) + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse.class, spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getItemsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + appId_ = ""; + + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + itemsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SubscribeConfigurationResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse build() { + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse result = new spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.appId_ = appId_; + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getAppId().isEmpty()) { + appId_ = other.appId_; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getItemsFieldBuilder() : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object appId_ = ""; + /** + *
+       * The application id.
+       * Only used for admin client.
+       * 
+ * + * string app_id = 2; + * @return The appId. + */ + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The application id.
+       * Only used for admin client.
+       * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The application id.
+       * Only used for admin client.
+       * 
+ * + * string app_id = 2; + * @param value The appId to set. + * @return This builder for chaining. + */ + public Builder setAppId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appId_ = value; + onChanged(); + return this; + } + /** + *
+       * The application id.
+       * Only used for admin client.
+       * 
+ * + * string app_id = 2; + * @return This builder for chaining. + */ + public Builder clearAppId() { + + appId_ = getDefaultInstance().getAppId(); + onChanged(); + return this; + } + /** + *
+       * The application id.
+       * Only used for admin client.
+       * 
+ * + * string app_id = 2; + * @param value The bytes for appId to set. + * @return This builder for chaining. + */ + public Builder setAppIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appId_ = value; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder, spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder> itemsBuilder_; + + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder setItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder setItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder addItems(spec.proto.runtime.v1.RuntimeProto.ConfigurationItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder addItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder addItems( + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder addItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder getItemsBuilder( + int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder getItemsOrBuilder( + int index) { + if (itemsBuilder_ == null) { + return items_.get(index); } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder addItemsBuilder() { + return getItemsFieldBuilder().addBuilder( + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.getDefaultInstance()); + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder addItemsBuilder( + int index) { + return getItemsFieldBuilder().addBuilder( + index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.getDefaultInstance()); + } + /** + *
+       * The list of items containing configuration values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public java.util.List + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder, spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder, spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder>( + items_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + items_ = null; + } + return itemsBuilder_; + } + @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:spec.proto.runtime.v1.SubscribeConfigurationResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.SubscribeConfigurationResponse) + private static final spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SubscribeConfigurationResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SubscribeConfigurationResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SubscribeConfigurationResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SaveConfigurationRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.SaveConfigurationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * The application id which
+     * Only used for admin, ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The appId. + */ + java.lang.String getAppId(); + /** + *
+     * The application id which
+     * Only used for admin, ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + com.google.protobuf.ByteString + getAppIdBytes(); + + /** + *
+     * The list of configuration items to save.
+     * To delete a exist item, set the key (also label) and let content to be empty
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + java.util.List + getItemsList(); + /** + *
+     * The list of configuration items to save.
+     * To delete a exist item, set the key (also label) and let content to be empty
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getItems(int index); + /** + *
+     * The list of configuration items to save.
+     * To delete a exist item, set the key (also label) and let content to be empty
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + int getItemsCount(); + /** + *
+     * The list of configuration items to save.
+     * To delete a exist item, set the key (also label) and let content to be empty
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + java.util.List + getItemsOrBuilderList(); + /** + *
+     * The list of configuration items to save.
+     * To delete a exist item, set the key (also label) and let content to be empty
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder getItemsOrBuilder( + int index); + + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + int getMetadataCount(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * SaveConfigurationRequest is the message to save a list of key-value configuration into specified configuration store.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.SaveConfigurationRequest} + */ + public static final class SaveConfigurationRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.SaveConfigurationRequest) + SaveConfigurationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SaveConfigurationRequest.newBuilder() to construct. + private SaveConfigurationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SaveConfigurationRequest() { + storeName_ = ""; + appId_ = ""; + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SaveConfigurationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SaveConfigurationRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + appId_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + items_.add( + input.readMessage(spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.parser(), extensionRegistry)); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest.class, spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object appId_; + /** + *
+     * The application id which
+     * Only used for admin, ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The appId. + */ + @java.lang.Override + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } + } + /** + *
+     * The application id which
+     * Only used for admin, ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ITEMS_FIELD_NUMBER = 3; + private java.util.List items_; + /** + *
+     * The list of configuration items to save.
+     * To delete a exist item, set the key (also label) and let content to be empty
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + /** + *
+     * The list of configuration items to save.
+     * To delete a exist item, set the key (also label) and let content to be empty
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + /** + *
+     * The list of configuration items to save.
+     * To delete a exist item, set the key (also label) and let content to be empty
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + /** + *
+     * The list of configuration items to save.
+     * To delete a exist item, set the key (also label) and let content to be empty
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getItems(int index) { + return items_.get(index); + } + /** + *
+     * The list of configuration items to save.
+     * To delete a exist item, set the key (also label) and let content to be empty
+     * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder getItemsOrBuilder( + int index) { + return items_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 4; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getAppIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appId_); + } + for (int i = 0; i < items_.size(); i++) { + output.writeMessage(3, items_.get(i)); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 4); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getAppIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appId_); + } + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, items_.get(i)); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest other = (spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getAppId() + .equals(other.getAppId())) return false; + if (!getItemsList() + .equals(other.getItemsList())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + APP_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppId().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest 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 spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest 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 spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest 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(spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest 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; + } + /** + *
+     * SaveConfigurationRequest is the message to save a list of key-value configuration into specified configuration store.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.SaveConfigurationRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.SaveConfigurationRequest) + spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest.class, spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getItemsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + appId_ = ""; + + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + itemsBuilder_.clear(); + } + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest build() { + spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest result = new spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.appId_ = appId_; + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getAppId().isEmpty()) { + appId_ = other.appId_; + onChanged(); + } + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getItemsFieldBuilder() : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object appId_ = ""; + /** + *
+       * The application id which
+       * Only used for admin, ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return The appId. + */ + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The application id which
+       * Only used for admin, ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The application id which
+       * Only used for admin, ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @param value The appId to set. + * @return This builder for chaining. + */ + public Builder setAppId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appId_ = value; + onChanged(); + return this; + } + /** + *
+       * The application id which
+       * Only used for admin, ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return This builder for chaining. + */ + public Builder clearAppId() { + + appId_ = getDefaultInstance().getAppId(); + onChanged(); + return this; + } + /** + *
+       * The application id which
+       * Only used for admin, ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @param value The bytes for appId to set. + * @return This builder for chaining. + */ + public Builder setAppIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appId_ = value; + onChanged(); + return this; + } + + private java.util.List items_ = + java.util.Collections.emptyList(); + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder, spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder> itemsBuilder_; + + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder setItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder setItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder addItems(spec.proto.runtime.v1.RuntimeProto.ConfigurationItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder addItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder addItems( + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder addItems( + int index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder getItemsBuilder( + int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder getItemsOrBuilder( + int index) { + if (itemsBuilder_ == null) { + return items_.get(index); } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder addItemsBuilder() { + return getItemsFieldBuilder().addBuilder( + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.getDefaultInstance()); + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder addItemsBuilder( + int index) { + return getItemsFieldBuilder().addBuilder( + index, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.getDefaultInstance()); + } + /** + *
+       * The list of configuration items to save.
+       * To delete a exist item, set the key (also label) and let content to be empty
+       * 
+ * + * repeated .spec.proto.runtime.v1.ConfigurationItem items = 3; + */ + public java.util.List + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder, spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.ConfigurationItem, spec.proto.runtime.v1.RuntimeProto.ConfigurationItem.Builder, spec.proto.runtime.v1.RuntimeProto.ConfigurationItemOrBuilder>( + items_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + items_ = null; + } + return itemsBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.SaveConfigurationRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.SaveConfigurationRequest) + private static final spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SaveConfigurationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SaveConfigurationRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SaveConfigurationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeleteConfigurationRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.DeleteConfigurationRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * The application id which
+     * Only used for admin, Ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The appId. + */ + java.lang.String getAppId(); + /** + *
+     * The application id which
+     * Only used for admin, Ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + com.google.protobuf.ByteString + getAppIdBytes(); + + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The group. + */ + java.lang.String getGroup(); + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The bytes for group. + */ + com.google.protobuf.ByteString + getGroupBytes(); + + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The label. + */ + java.lang.String getLabel(); + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The bytes for label. + */ + com.google.protobuf.ByteString + getLabelBytes(); + + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return A list containing the keys. + */ + java.util.List + getKeysList(); + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return The count of keys. + */ + int getKeysCount(); + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + java.lang.String getKeys(int index); + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + com.google.protobuf.ByteString + getKeysBytes(int index); + + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + int getMetadataCount(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * DeleteConfigurationRequest is the message to delete a list of key-value configuration from specified configuration store.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.DeleteConfigurationRequest} + */ + public static final class DeleteConfigurationRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.DeleteConfigurationRequest) + DeleteConfigurationRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteConfigurationRequest.newBuilder() to construct. + private DeleteConfigurationRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteConfigurationRequest() { + storeName_ = ""; + appId_ = ""; + group_ = ""; + label_ = ""; + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteConfigurationRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteConfigurationRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + appId_ = s; + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + group_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + label_ = s; + break; + } + case 42: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + keys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + keys_.add(s); + break; + } + case 50: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + keys_ = keys_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 6: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest.class, spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * The name of configuration store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int APP_ID_FIELD_NUMBER = 2; + private volatile java.lang.Object appId_; + /** + *
+     * The application id which
+     * Only used for admin, Ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The appId. + */ + @java.lang.Override + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + return (java.lang.String) ref; + } else { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } + } + /** + *
+     * The application id which
+     * Only used for admin, Ignored and reset for normal client
+     * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int GROUP_FIELD_NUMBER = 3; + private volatile java.lang.Object group_; + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The group. + */ + @java.lang.Override + public java.lang.String getGroup() { + java.lang.Object ref = group_; + 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(); + group_ = s; + return s; + } + } + /** + *
+     * The group of keys.
+     * 
+ * + * string group = 3; + * @return The bytes for group. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getGroupBytes() { + java.lang.Object ref = group_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + group_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int LABEL_FIELD_NUMBER = 4; + private volatile java.lang.Object label_; + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The label. + */ + @java.lang.Override + public java.lang.String getLabel() { + java.lang.Object ref = label_; + 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(); + label_ = s; + return s; + } + } + /** + *
+     * The label for keys.
+     * 
+ * + * string label = 4; + * @return The bytes for label. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEYS_FIELD_NUMBER = 5; + private com.google.protobuf.LazyStringList keys_; + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return A list containing the keys. + */ + public com.google.protobuf.ProtocolStringList + getKeysList() { + return keys_; + } + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @return The count of keys. + */ + public int getKeysCount() { + return keys_.size(); + } + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + public java.lang.String getKeys(int index) { + return keys_.get(index); + } + /** + *
+     * The keys to get.
+     * 
+ * + * repeated string keys = 5; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + public com.google.protobuf.ByteString + getKeysBytes(int index) { + return keys_.getByteString(index); + } + + public static final int METADATA_FIELD_NUMBER = 6; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata which will be sent to configuration store components.
+     * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getAppIdBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, appId_); + } + if (!getGroupBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, group_); + } + if (!getLabelBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, label_); + } + for (int i = 0; i < keys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 5, keys_.getRaw(i)); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 6); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getAppIdBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, appId_); + } + if (!getGroupBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, group_); + } + if (!getLabelBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, label_); + } + { + int dataSize = 0; + for (int i = 0; i < keys_.size(); i++) { + dataSize += computeStringSizeNoTag(keys_.getRaw(i)); + } + size += dataSize; + size += 1 * getKeysList().size(); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(6, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest other = (spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getAppId() + .equals(other.getAppId())) return false; + if (!getGroup() + .equals(other.getGroup())) return false; + if (!getLabel() + .equals(other.getLabel())) return false; + if (!getKeysList() + .equals(other.getKeysList())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + APP_ID_FIELD_NUMBER; + hash = (53 * hash) + getAppId().hashCode(); + hash = (37 * hash) + GROUP_FIELD_NUMBER; + hash = (53 * hash) + getGroup().hashCode(); + hash = (37 * hash) + LABEL_FIELD_NUMBER; + hash = (53 * hash) + getLabel().hashCode(); + if (getKeysCount() > 0) { + hash = (37 * hash) + KEYS_FIELD_NUMBER; + hash = (53 * hash) + getKeysList().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest 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 spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest 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 spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest 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(spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest 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; + } + /** + *
+     * DeleteConfigurationRequest is the message to delete a list of key-value configuration from specified configuration store.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.DeleteConfigurationRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.DeleteConfigurationRequest) + spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 6: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 6: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest.class, spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + appId_ = ""; + + group_ = ""; + + label_ = ""; + + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest build() { + spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest result = new spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.appId_ = appId_; + result.group_ = group_; + result.label_ = label_; + if (((bitField0_ & 0x00000001) != 0)) { + keys_ = keys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.keys_ = keys_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getAppId().isEmpty()) { + appId_ = other.appId_; + onChanged(); + } + if (!other.getGroup().isEmpty()) { + group_ = other.group_; + onChanged(); + } + if (!other.getLabel().isEmpty()) { + label_ = other.label_; + onChanged(); + } + if (!other.keys_.isEmpty()) { + if (keys_.isEmpty()) { + keys_ = other.keys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKeysIsMutable(); + keys_.addAll(other.keys_); + } + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * The name of configuration store.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object appId_ = ""; + /** + *
+       * The application id which
+       * Only used for admin, Ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return The appId. + */ + public java.lang.String getAppId() { + java.lang.Object ref = appId_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + appId_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The application id which
+       * Only used for admin, Ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return The bytes for appId. + */ + public com.google.protobuf.ByteString + getAppIdBytes() { + java.lang.Object ref = appId_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + appId_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The application id which
+       * Only used for admin, Ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @param value The appId to set. + * @return This builder for chaining. + */ + public Builder setAppId( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + appId_ = value; + onChanged(); + return this; + } + /** + *
+       * The application id which
+       * Only used for admin, Ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @return This builder for chaining. + */ + public Builder clearAppId() { + + appId_ = getDefaultInstance().getAppId(); + onChanged(); + return this; + } + /** + *
+       * The application id which
+       * Only used for admin, Ignored and reset for normal client
+       * 
+ * + * string app_id = 2; + * @param value The bytes for appId to set. + * @return This builder for chaining. + */ + public Builder setAppIdBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + appId_ = value; + onChanged(); + return this; + } + + private java.lang.Object group_ = ""; + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @return The group. + */ + public java.lang.String getGroup() { + java.lang.Object ref = group_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + group_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @return The bytes for group. + */ + public com.google.protobuf.ByteString + getGroupBytes() { + java.lang.Object ref = group_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + group_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @param value The group to set. + * @return This builder for chaining. + */ + public Builder setGroup( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + group_ = value; + onChanged(); + return this; + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @return This builder for chaining. + */ + public Builder clearGroup() { + + group_ = getDefaultInstance().getGroup(); + onChanged(); + return this; + } + /** + *
+       * The group of keys.
+       * 
+ * + * string group = 3; + * @param value The bytes for group to set. + * @return This builder for chaining. + */ + public Builder setGroupBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + group_ = value; + onChanged(); + return this; + } + + private java.lang.Object label_ = ""; + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @return The label. + */ + public java.lang.String getLabel() { + java.lang.Object ref = label_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + label_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @return The bytes for label. + */ + public com.google.protobuf.ByteString + getLabelBytes() { + java.lang.Object ref = label_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + label_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @param value The label to set. + * @return This builder for chaining. + */ + public Builder setLabel( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + label_ = value; + onChanged(); + return this; + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @return This builder for chaining. + */ + public Builder clearLabel() { + + label_ = getDefaultInstance().getLabel(); + onChanged(); + return this; + } + /** + *
+       * The label for keys.
+       * 
+ * + * string label = 4; + * @param value The bytes for label to set. + * @return This builder for chaining. + */ + public Builder setLabelBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + label_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + keys_ = new com.google.protobuf.LazyStringArrayList(keys_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @return A list containing the keys. + */ + public com.google.protobuf.ProtocolStringList + getKeysList() { + return keys_.getUnmodifiableView(); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @return The count of keys. + */ + public int getKeysCount() { + return keys_.size(); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + public java.lang.String getKeys(int index) { + return keys_.get(index); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + public com.google.protobuf.ByteString + getKeysBytes(int index) { + return keys_.getByteString(index); + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param index The index to set the value at. + * @param value The keys to set. + * @return This builder for chaining. + */ + public Builder setKeys( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param value The keys to add. + * @return This builder for chaining. + */ + public Builder addKeys( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.add(value); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param values The keys to add. + * @return This builder for chaining. + */ + public Builder addAllKeys( + java.lang.Iterable values) { + ensureKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, keys_); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @return This builder for chaining. + */ + public Builder clearKeys() { + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+       * The keys to get.
+       * 
+ * + * repeated string keys = 5; + * @param value The bytes of the keys to add. + * @return This builder for chaining. + */ + public Builder addKeysBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureKeysIsMutable(); + keys_.add(value); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata which will be sent to configuration store components.
+       * 
+ * + * map<string, string> metadata = 6; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.DeleteConfigurationRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.DeleteConfigurationRequest) + private static final spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteConfigurationRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteConfigurationRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteConfigurationRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetStateRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetStateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * Required. The key of the desired state
+     * 
+ * + * string key = 2; + * @return The key. + */ + java.lang.String getKey(); + /** + *
+     * Required. The key of the desired state
+     * 
+ * + * string key = 2; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + *
+     * (optional) read consistency mode
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 3; + * @return The enum numeric value on the wire for consistency. + */ + int getConsistencyValue(); + /** + *
+     * (optional) read consistency mode
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 3; + * @return The consistency. + */ + spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency getConsistency(); + + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + int getMetadataCount(); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * GetStateRequest is the message to get key-value states from specific state store.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetStateRequest} + */ + public static final class GetStateRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetStateRequest) + GetStateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetStateRequest.newBuilder() to construct. + private GetStateRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetStateRequest() { + storeName_ = ""; + key_ = ""; + consistency_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetStateRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetStateRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 24: { + int rawValue = input.readEnum(); + + consistency_ = rawValue; + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetStateRequest.class, spec.proto.runtime.v1.RuntimeProto.GetStateRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object key_; + /** + *
+     * Required. The key of the desired state
+     * 
+ * + * string key = 2; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + *
+     * Required. The key of the desired state
+     * 
+ * + * string key = 2; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int CONSISTENCY_FIELD_NUMBER = 3; + private int consistency_; + /** + *
+     * (optional) read consistency mode
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 3; + * @return The enum numeric value on the wire for consistency. + */ + @java.lang.Override public int getConsistencyValue() { + return consistency_; + } + /** + *
+     * (optional) read consistency mode
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 3; + * @return The consistency. + */ + @java.lang.Override public spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency getConsistency() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency result = spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.valueOf(consistency_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.UNRECOGNIZED : result; + } + + public static final int METADATA_FIELD_NUMBER = 4; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + if (consistency_ != spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.CONSISTENCY_UNSPECIFIED.getNumber()) { + output.writeEnum(3, consistency_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 4); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + if (consistency_ != spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.CONSISTENCY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(3, consistency_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetStateRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetStateRequest other = (spec.proto.runtime.v1.RuntimeProto.GetStateRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getKey() + .equals(other.getKey())) return false; + if (consistency_ != other.consistency_) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + CONSISTENCY_FIELD_NUMBER; + hash = (53 * hash) + consistency_; + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest 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 spec.proto.runtime.v1.RuntimeProto.GetStateRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest 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 spec.proto.runtime.v1.RuntimeProto.GetStateRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest 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(spec.proto.runtime.v1.RuntimeProto.GetStateRequest 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; + } + /** + *
+     * GetStateRequest is the message to get key-value states from specific state store.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetStateRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetStateRequest) + spec.proto.runtime.v1.RuntimeProto.GetStateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetStateRequest.class, spec.proto.runtime.v1.RuntimeProto.GetStateRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetStateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + key_ = ""; + + consistency_ = 0; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetStateRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetStateRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetStateRequest build() { + spec.proto.runtime.v1.RuntimeProto.GetStateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetStateRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetStateRequest result = new spec.proto.runtime.v1.RuntimeProto.GetStateRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.key_ = key_; + result.consistency_ = consistency_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetStateRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetStateRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetStateRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetStateRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.consistency_ != 0) { + setConsistencyValue(other.getConsistencyValue()); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetStateRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetStateRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + *
+       * Required. The key of the desired state
+       * 
+ * + * string key = 2; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The key of the desired state
+       * 
+ * + * string key = 2; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The key of the desired state
+       * 
+ * + * string key = 2; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The key of the desired state
+       * 
+ * + * string key = 2; + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + *
+       * Required. The key of the desired state
+       * 
+ * + * string key = 2; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private int consistency_ = 0; + /** + *
+       * (optional) read consistency mode
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 3; + * @return The enum numeric value on the wire for consistency. + */ + @java.lang.Override public int getConsistencyValue() { + return consistency_; + } + /** + *
+       * (optional) read consistency mode
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 3; + * @param value The enum numeric value on the wire for consistency to set. + * @return This builder for chaining. + */ + public Builder setConsistencyValue(int value) { + + consistency_ = value; + onChanged(); + return this; + } + /** + *
+       * (optional) read consistency mode
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 3; + * @return The consistency. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency getConsistency() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency result = spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.valueOf(consistency_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.UNRECOGNIZED : result; + } + /** + *
+       * (optional) read consistency mode
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 3; + * @param value The consistency to set. + * @return This builder for chaining. + */ + public Builder setConsistency(spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency value) { + if (value == null) { + throw new NullPointerException(); + } + + consistency_ = value.getNumber(); + onChanged(); + return this; + } + /** + *
+       * (optional) read consistency mode
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 3; + * @return This builder for chaining. + */ + public Builder clearConsistency() { + + consistency_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.GetStateRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetStateRequest) + private static final spec.proto.runtime.v1.RuntimeProto.GetStateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetStateRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetStateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetStateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetStateRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetStateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetBulkStateRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetBulkStateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * Required. The keys to get.
+     * 
+ * + * repeated string keys = 2; + * @return A list containing the keys. + */ + java.util.List + getKeysList(); + /** + *
+     * Required. The keys to get.
+     * 
+ * + * repeated string keys = 2; + * @return The count of keys. + */ + int getKeysCount(); + /** + *
+     * Required. The keys to get.
+     * 
+ * + * repeated string keys = 2; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + java.lang.String getKeys(int index); + /** + *
+     * Required. The keys to get.
+     * 
+ * + * repeated string keys = 2; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + com.google.protobuf.ByteString + getKeysBytes(int index); + + /** + *
+     * (optional) The number of parallel operations executed on the state store for a get operation.
+     * 
+ * + * int32 parallelism = 3; + * @return The parallelism. + */ + int getParallelism(); + + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + int getMetadataCount(); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * GetBulkStateRequest is the message to get a list of key-value states from specific state store.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetBulkStateRequest} + */ + public static final class GetBulkStateRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetBulkStateRequest) + GetBulkStateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBulkStateRequest.newBuilder() to construct. + private GetBulkStateRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetBulkStateRequest() { + storeName_ = ""; + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetBulkStateRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetBulkStateRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + keys_ = new com.google.protobuf.LazyStringArrayList(); + mutable_bitField0_ |= 0x00000001; + } + keys_.add(s); + break; + } + case 24: { + + parallelism_ = input.readInt32(); + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + keys_ = keys_.getUnmodifiableView(); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest.class, spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEYS_FIELD_NUMBER = 2; + private com.google.protobuf.LazyStringList keys_; + /** + *
+     * Required. The keys to get.
+     * 
+ * + * repeated string keys = 2; + * @return A list containing the keys. + */ + public com.google.protobuf.ProtocolStringList + getKeysList() { + return keys_; + } + /** + *
+     * Required. The keys to get.
+     * 
+ * + * repeated string keys = 2; + * @return The count of keys. + */ + public int getKeysCount() { + return keys_.size(); + } + /** + *
+     * Required. The keys to get.
+     * 
+ * + * repeated string keys = 2; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + public java.lang.String getKeys(int index) { + return keys_.get(index); + } + /** + *
+     * Required. The keys to get.
+     * 
+ * + * repeated string keys = 2; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + public com.google.protobuf.ByteString + getKeysBytes(int index) { + return keys_.getByteString(index); + } + + public static final int PARALLELISM_FIELD_NUMBER = 3; + private int parallelism_; + /** + *
+     * (optional) The number of parallel operations executed on the state store for a get operation.
+     * 
+ * + * int32 parallelism = 3; + * @return The parallelism. + */ + @java.lang.Override + public int getParallelism() { + return parallelism_; + } + + public static final int METADATA_FIELD_NUMBER = 4; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + for (int i = 0; i < keys_.size(); i++) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, keys_.getRaw(i)); + } + if (parallelism_ != 0) { + output.writeInt32(3, parallelism_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 4); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + { + int dataSize = 0; + for (int i = 0; i < keys_.size(); i++) { + dataSize += computeStringSizeNoTag(keys_.getRaw(i)); + } + size += dataSize; + size += 1 * getKeysList().size(); + } + if (parallelism_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(3, parallelism_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest other = (spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getKeysList() + .equals(other.getKeysList())) return false; + if (getParallelism() + != other.getParallelism()) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + if (getKeysCount() > 0) { + hash = (37 * hash) + KEYS_FIELD_NUMBER; + hash = (53 * hash) + getKeysList().hashCode(); + } + hash = (37 * hash) + PARALLELISM_FIELD_NUMBER; + hash = (53 * hash) + getParallelism(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest 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 spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest 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 spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest 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(spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest 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; + } + /** + *
+     * GetBulkStateRequest is the message to get a list of key-value states from specific state store.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetBulkStateRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetBulkStateRequest) + spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest.class, spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + parallelism_ = 0; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest build() { + spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest result = new spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + if (((bitField0_ & 0x00000001) != 0)) { + keys_ = keys_.getUnmodifiableView(); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.keys_ = keys_; + result.parallelism_ = parallelism_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.keys_.isEmpty()) { + if (keys_.isEmpty()) { + keys_ = other.keys_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureKeysIsMutable(); + keys_.addAll(other.keys_); + } + onChanged(); + } + if (other.getParallelism() != 0) { + setParallelism(other.getParallelism()); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.LazyStringList keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + private void ensureKeysIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + keys_ = new com.google.protobuf.LazyStringArrayList(keys_); + bitField0_ |= 0x00000001; + } + } + /** + *
+       * Required. The keys to get.
+       * 
+ * + * repeated string keys = 2; + * @return A list containing the keys. + */ + public com.google.protobuf.ProtocolStringList + getKeysList() { + return keys_.getUnmodifiableView(); + } + /** + *
+       * Required. The keys to get.
+       * 
+ * + * repeated string keys = 2; + * @return The count of keys. + */ + public int getKeysCount() { + return keys_.size(); + } + /** + *
+       * Required. The keys to get.
+       * 
+ * + * repeated string keys = 2; + * @param index The index of the element to return. + * @return The keys at the given index. + */ + public java.lang.String getKeys(int index) { + return keys_.get(index); + } + /** + *
+       * Required. The keys to get.
+       * 
+ * + * repeated string keys = 2; + * @param index The index of the value to return. + * @return The bytes of the keys at the given index. + */ + public com.google.protobuf.ByteString + getKeysBytes(int index) { + return keys_.getByteString(index); + } + /** + *
+       * Required. The keys to get.
+       * 
+ * + * repeated string keys = 2; + * @param index The index to set the value at. + * @param value The keys to set. + * @return This builder for chaining. + */ + public Builder setKeys( + int index, java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.set(index, value); + onChanged(); + return this; + } + /** + *
+       * Required. The keys to get.
+       * 
+ * + * repeated string keys = 2; + * @param value The keys to add. + * @return This builder for chaining. + */ + public Builder addKeys( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + ensureKeysIsMutable(); + keys_.add(value); + onChanged(); + return this; + } + /** + *
+       * Required. The keys to get.
+       * 
+ * + * repeated string keys = 2; + * @param values The keys to add. + * @return This builder for chaining. + */ + public Builder addAllKeys( + java.lang.Iterable values) { + ensureKeysIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, keys_); + onChanged(); + return this; + } + /** + *
+       * Required. The keys to get.
+       * 
+ * + * repeated string keys = 2; + * @return This builder for chaining. + */ + public Builder clearKeys() { + keys_ = com.google.protobuf.LazyStringArrayList.EMPTY; + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + *
+       * Required. The keys to get.
+       * 
+ * + * repeated string keys = 2; + * @param value The bytes of the keys to add. + * @return This builder for chaining. + */ + public Builder addKeysBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + ensureKeysIsMutable(); + keys_.add(value); + onChanged(); + return this; + } + + private int parallelism_ ; + /** + *
+       * (optional) The number of parallel operations executed on the state store for a get operation.
+       * 
+ * + * int32 parallelism = 3; + * @return The parallelism. + */ + @java.lang.Override + public int getParallelism() { + return parallelism_; + } + /** + *
+       * (optional) The number of parallel operations executed on the state store for a get operation.
+       * 
+ * + * int32 parallelism = 3; + * @param value The parallelism to set. + * @return This builder for chaining. + */ + public Builder setParallelism(int value) { + + parallelism_ = value; + onChanged(); + return this; + } + /** + *
+       * (optional) The number of parallel operations executed on the state store for a get operation.
+       * 
+ * + * int32 parallelism = 3; + * @return This builder for chaining. + */ + public Builder clearParallelism() { + + parallelism_ = 0; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.GetBulkStateRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetBulkStateRequest) + private static final spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBulkStateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBulkStateRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetBulkStateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetBulkStateResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetBulkStateResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The list of items containing the keys to get values for.
+     * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + java.util.List + getItemsList(); + /** + *
+     * The list of items containing the keys to get values for.
+     * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + spec.proto.runtime.v1.RuntimeProto.BulkStateItem getItems(int index); + /** + *
+     * The list of items containing the keys to get values for.
+     * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + int getItemsCount(); + /** + *
+     * The list of items containing the keys to get values for.
+     * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + java.util.List + getItemsOrBuilderList(); + /** + *
+     * The list of items containing the keys to get values for.
+     * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + spec.proto.runtime.v1.RuntimeProto.BulkStateItemOrBuilder getItemsOrBuilder( + int index); + } + /** + *
+   * GetBulkStateResponse is the response conveying the list of state values.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetBulkStateResponse} + */ + public static final class GetBulkStateResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetBulkStateResponse) + GetBulkStateResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetBulkStateResponse.newBuilder() to construct. + private GetBulkStateResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetBulkStateResponse() { + items_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetBulkStateResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetBulkStateResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + items_.add( + input.readMessage(spec.proto.runtime.v1.RuntimeProto.BulkStateItem.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse.class, spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse.Builder.class); + } + + public static final int ITEMS_FIELD_NUMBER = 1; + private java.util.List items_; + /** + *
+     * The list of items containing the keys to get values for.
+     * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + @java.lang.Override + public java.util.List getItemsList() { + return items_; + } + /** + *
+     * The list of items containing the keys to get values for.
+     * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + @java.lang.Override + public java.util.List + getItemsOrBuilderList() { + return items_; + } + /** + *
+     * The list of items containing the keys to get values for.
+     * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + @java.lang.Override + public int getItemsCount() { + return items_.size(); + } + /** + *
+     * The list of items containing the keys to get values for.
+     * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.BulkStateItem getItems(int index) { + return items_.get(index); + } + /** + *
+     * The list of items containing the keys to get values for.
+     * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.BulkStateItemOrBuilder getItemsOrBuilder( + int index) { + return items_.get(index); + } + + 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 < items_.size(); i++) { + output.writeMessage(1, items_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (int i = 0; i < items_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, items_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse other = (spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse) obj; + + if (!getItemsList() + .equals(other.getItemsList())) return false; + if (!unknownFields.equals(other.unknownFields)) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getItemsCount() > 0) { + hash = (37 * hash) + ITEMS_FIELD_NUMBER; + hash = (53 * hash) + getItemsList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse 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 spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse 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 spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse 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(spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse 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; + } + /** + *
+     * GetBulkStateResponse is the response conveying the list of state values.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetBulkStateResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetBulkStateResponse) + spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateResponse_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse.class, spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getItemsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + itemsBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetBulkStateResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse build() { + spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse result = new spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse(this); + int from_bitField0_ = bitField0_; + if (itemsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + items_ = java.util.Collections.unmodifiableList(items_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.items_ = items_; + } else { + result.items_ = itemsBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse.getDefaultInstance()) return this; + if (itemsBuilder_ == null) { + if (!other.items_.isEmpty()) { + if (items_.isEmpty()) { + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureItemsIsMutable(); + items_.addAll(other.items_); + } + onChanged(); + } + } else { + if (!other.items_.isEmpty()) { + if (itemsBuilder_.isEmpty()) { + itemsBuilder_.dispose(); + itemsBuilder_ = null; + items_ = other.items_; + bitField0_ = (bitField0_ & ~0x00000001); + itemsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getItemsFieldBuilder() : null; + } else { + itemsBuilder_.addAllMessages(other.items_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.util.List items_ = + java.util.Collections.emptyList(); + private void ensureItemsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + items_ = new java.util.ArrayList(items_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.BulkStateItem, spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder, spec.proto.runtime.v1.RuntimeProto.BulkStateItemOrBuilder> itemsBuilder_; + + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public java.util.List getItemsList() { + if (itemsBuilder_ == null) { + return java.util.Collections.unmodifiableList(items_); + } else { + return itemsBuilder_.getMessageList(); + } + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public int getItemsCount() { + if (itemsBuilder_ == null) { + return items_.size(); + } else { + return itemsBuilder_.getCount(); + } + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.BulkStateItem getItems(int index) { + if (itemsBuilder_ == null) { + return items_.get(index); + } else { + return itemsBuilder_.getMessage(index); + } + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public Builder setItems( + int index, spec.proto.runtime.v1.RuntimeProto.BulkStateItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.set(index, value); + onChanged(); + } else { + itemsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public Builder setItems( + int index, spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.set(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public Builder addItems(spec.proto.runtime.v1.RuntimeProto.BulkStateItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(value); + onChanged(); + } else { + itemsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public Builder addItems( + int index, spec.proto.runtime.v1.RuntimeProto.BulkStateItem value) { + if (itemsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureItemsIsMutable(); + items_.add(index, value); + onChanged(); + } else { + itemsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public Builder addItems( + spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public Builder addItems( + int index, spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder builderForValue) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.add(index, builderForValue.build()); + onChanged(); + } else { + itemsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public Builder addAllItems( + java.lang.Iterable values) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, items_); + onChanged(); + } else { + itemsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public Builder clearItems() { + if (itemsBuilder_ == null) { + items_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + itemsBuilder_.clear(); + } + return this; + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public Builder removeItems(int index) { + if (itemsBuilder_ == null) { + ensureItemsIsMutable(); + items_.remove(index); + onChanged(); + } else { + itemsBuilder_.remove(index); + } + return this; + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder getItemsBuilder( + int index) { + return getItemsFieldBuilder().getBuilder(index); + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.BulkStateItemOrBuilder getItemsOrBuilder( + int index) { + if (itemsBuilder_ == null) { + return items_.get(index); } else { + return itemsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public java.util.List + getItemsOrBuilderList() { + if (itemsBuilder_ != null) { + return itemsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(items_); + } + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder addItemsBuilder() { + return getItemsFieldBuilder().addBuilder( + spec.proto.runtime.v1.RuntimeProto.BulkStateItem.getDefaultInstance()); + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder addItemsBuilder( + int index) { + return getItemsFieldBuilder().addBuilder( + index, spec.proto.runtime.v1.RuntimeProto.BulkStateItem.getDefaultInstance()); + } + /** + *
+       * The list of items containing the keys to get values for.
+       * 
+ * + * repeated .spec.proto.runtime.v1.BulkStateItem items = 1; + */ + public java.util.List + getItemsBuilderList() { + return getItemsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.BulkStateItem, spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder, spec.proto.runtime.v1.RuntimeProto.BulkStateItemOrBuilder> + getItemsFieldBuilder() { + if (itemsBuilder_ == null) { + itemsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.BulkStateItem, spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder, spec.proto.runtime.v1.RuntimeProto.BulkStateItemOrBuilder>( + items_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + items_ = null; + } + return itemsBuilder_; + } + @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:spec.proto.runtime.v1.GetBulkStateResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetBulkStateResponse) + private static final spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetBulkStateResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetBulkStateResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetBulkStateResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface BulkStateItemOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.BulkStateItem) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * state item key
+     * 
+ * + * string key = 1; + * @return The key. + */ + java.lang.String getKey(); + /** + *
+     * state item key
+     * 
+ * + * string key = 1; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + *
+     * The byte array data
+     * 
+ * + * bytes data = 2; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
+     * The entity tag which represents the specific version of data.
+     * ETag format is defined by the corresponding data store.
+     * 
+ * + * string etag = 3; + * @return The etag. + */ + java.lang.String getEtag(); + /** + *
+     * The entity tag which represents the specific version of data.
+     * ETag format is defined by the corresponding data store.
+     * 
+ * + * string etag = 3; + * @return The bytes for etag. + */ + com.google.protobuf.ByteString + getEtagBytes(); + + /** + *
+     * The error that was returned from the state store in case of a failed get operation.
+     * 
+ * + * string error = 4; + * @return The error. + */ + java.lang.String getError(); + /** + *
+     * The error that was returned from the state store in case of a failed get operation.
+     * 
+ * + * string error = 4; + * @return The bytes for error. + */ + com.google.protobuf.ByteString + getErrorBytes(); + + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 5; + */ + int getMetadataCount(); + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 5; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 5; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 5; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 5; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * BulkStateItem is the response item for a bulk get operation.
+   * Return values include the item key, data and etag.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.BulkStateItem} + */ + public static final class BulkStateItem extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.BulkStateItem) + BulkStateItemOrBuilder { + private static final long serialVersionUID = 0L; + // Use BulkStateItem.newBuilder() to construct. + private BulkStateItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private BulkStateItem() { + key_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + etag_ = ""; + error_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new BulkStateItem(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private BulkStateItem( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + + data_ = input.readBytes(); + break; + } + case 26: { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + error_ = s; + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_BulkStateItem_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_BulkStateItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.BulkStateItem.class, spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + *
+     * state item key
+     * 
+ * + * string key = 1; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + *
+     * state item key
+     * 
+ * + * string key = 1; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + *
+     * The byte array data
+     * 
+ * + * bytes data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int ETAG_FIELD_NUMBER = 3; + private volatile java.lang.Object etag_; + /** + *
+     * The entity tag which represents the specific version of data.
+     * ETag format is defined by the corresponding data store.
+     * 
+ * + * string etag = 3; + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + *
+     * The entity tag which represents the specific version of data.
+     * ETag format is defined by the corresponding data store.
+     * 
+ * + * string etag = 3; + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ERROR_FIELD_NUMBER = 4; + private volatile java.lang.Object error_; + /** + *
+     * The error that was returned from the state store in case of a failed get operation.
+     * 
+ * + * string error = 4; + * @return The error. + */ + @java.lang.Override + public java.lang.String getError() { + java.lang.Object ref = error_; + 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(); + error_ = s; + return s; + } + } + /** + *
+     * The error that was returned from the state store in case of a failed get operation.
+     * 
+ * + * string error = 4; + * @return The bytes for error. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getErrorBytes() { + java.lang.Object ref = error_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + error_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 5; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_BulkStateItem_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 5; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!data_.isEmpty()) { + output.writeBytes(2, data_); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 3, etag_); + } + if (!getErrorBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, error_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 5); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, data_); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, etag_); + } + if (!getErrorBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, error_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.BulkStateItem)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.BulkStateItem other = (spec.proto.runtime.v1.RuntimeProto.BulkStateItem) obj; + + if (!getKey() + .equals(other.getKey())) return false; + if (!getData() + .equals(other.getData())) return false; + if (!getEtag() + .equals(other.getEtag())) return false; + if (!getError() + .equals(other.getError())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + hash = (37 * hash) + ERROR_FIELD_NUMBER; + hash = (53 * hash) + getError().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem 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 spec.proto.runtime.v1.RuntimeProto.BulkStateItem parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem 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 spec.proto.runtime.v1.RuntimeProto.BulkStateItem parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem 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(spec.proto.runtime.v1.RuntimeProto.BulkStateItem 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; + } + /** + *
+     * BulkStateItem is the response item for a bulk get operation.
+     * Return values include the item key, data and etag.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.BulkStateItem} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.BulkStateItem) + spec.proto.runtime.v1.RuntimeProto.BulkStateItemOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_BulkStateItem_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_BulkStateItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.BulkStateItem.class, spec.proto.runtime.v1.RuntimeProto.BulkStateItem.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.BulkStateItem.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + data_ = com.google.protobuf.ByteString.EMPTY; + + etag_ = ""; + + error_ = ""; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_BulkStateItem_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.BulkStateItem getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.BulkStateItem.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.BulkStateItem build() { + spec.proto.runtime.v1.RuntimeProto.BulkStateItem result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.BulkStateItem buildPartial() { + spec.proto.runtime.v1.RuntimeProto.BulkStateItem result = new spec.proto.runtime.v1.RuntimeProto.BulkStateItem(this); + int from_bitField0_ = bitField0_; + result.key_ = key_; + result.data_ = data_; + result.etag_ = etag_; + result.error_ = error_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.BulkStateItem) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.BulkStateItem)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.BulkStateItem other) { + if (other == spec.proto.runtime.v1.RuntimeProto.BulkStateItem.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + if (!other.getError().isEmpty()) { + error_ = other.error_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.BulkStateItem parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.BulkStateItem) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + *
+       * state item key
+       * 
+ * + * string key = 1; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * state item key
+       * 
+ * + * string key = 1; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * state item key
+       * 
+ * + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + *
+       * state item key
+       * 
+ * + * string key = 1; + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + *
+       * state item key
+       * 
+ * + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The byte array data
+       * 
+ * + * bytes data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+       * The byte array data
+       * 
+ * + * bytes data = 2; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
+       * The byte array data
+       * 
+ * + * bytes data = 2; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + *
+       * The entity tag which represents the specific version of data.
+       * ETag format is defined by the corresponding data store.
+       * 
+ * + * string etag = 3; + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The entity tag which represents the specific version of data.
+       * ETag format is defined by the corresponding data store.
+       * 
+ * + * string etag = 3; + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString + getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The entity tag which represents the specific version of data.
+       * ETag format is defined by the corresponding data store.
+       * 
+ * + * string etag = 3; + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + *
+       * The entity tag which represents the specific version of data.
+       * ETag format is defined by the corresponding data store.
+       * 
+ * + * string etag = 3; + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + *
+       * The entity tag which represents the specific version of data.
+       * ETag format is defined by the corresponding data store.
+       * 
+ * + * string etag = 3; + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + private java.lang.Object error_ = ""; + /** + *
+       * The error that was returned from the state store in case of a failed get operation.
+       * 
+ * + * string error = 4; + * @return The error. + */ + public java.lang.String getError() { + java.lang.Object ref = error_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + error_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The error that was returned from the state store in case of a failed get operation.
+       * 
+ * + * string error = 4; + * @return The bytes for error. + */ + public com.google.protobuf.ByteString + getErrorBytes() { + java.lang.Object ref = error_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + error_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The error that was returned from the state store in case of a failed get operation.
+       * 
+ * + * string error = 4; + * @param value The error to set. + * @return This builder for chaining. + */ + public Builder setError( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + error_ = value; + onChanged(); + return this; + } + /** + *
+       * The error that was returned from the state store in case of a failed get operation.
+       * 
+ * + * string error = 4; + * @return This builder for chaining. + */ + public Builder clearError() { + + error_ = getDefaultInstance().getError(); + onChanged(); + return this; + } + /** + *
+       * The error that was returned from the state store in case of a failed get operation.
+       * 
+ * + * string error = 4; + * @param value The bytes for error to set. + * @return This builder for chaining. + */ + public Builder setErrorBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + error_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 5; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 5; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 5; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 5; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.BulkStateItem) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.BulkStateItem) + private static final spec.proto.runtime.v1.RuntimeProto.BulkStateItem DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.BulkStateItem(); + } + + public static spec.proto.runtime.v1.RuntimeProto.BulkStateItem getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public BulkStateItem parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new BulkStateItem(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.BulkStateItem getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface GetStateResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.GetStateResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The byte array data
+     * 
+ * + * bytes data = 1; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
+     * The entity tag which represents the specific version of data.
+     * ETag format is defined by the corresponding data store.
+     * 
+ * + * string etag = 2; + * @return The etag. + */ + java.lang.String getEtag(); + /** + *
+     * The entity tag which represents the specific version of data.
+     * ETag format is defined by the corresponding data store.
+     * 
+ * + * string etag = 2; + * @return The bytes for etag. + */ + com.google.protobuf.ByteString + getEtagBytes(); + + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 3; + */ + int getMetadataCount(); + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 3; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 3; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * GetStateResponse is the response conveying the state value and etag.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetStateResponse} + */ + public static final class GetStateResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.GetStateResponse) + GetStateResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use GetStateResponse.newBuilder() to construct. + private GetStateResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private GetStateResponse() { + data_ = com.google.protobuf.ByteString.EMPTY; + etag_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new GetStateResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private GetStateResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + + data_ = input.readBytes(); + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + etag_ = s; + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetStateResponse.class, spec.proto.runtime.v1.RuntimeProto.GetStateResponse.Builder.class); + } + + public static final int DATA_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString data_; + /** + *
+     * The byte array data
+     * 
+ * + * bytes data = 1; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int ETAG_FIELD_NUMBER = 2; + private volatile java.lang.Object etag_; + /** + *
+     * The entity tag which represents the specific version of data.
+     * ETag format is defined by the corresponding data store.
+     * 
+ * + * string etag = 2; + * @return The etag. + */ + @java.lang.Override + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + 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(); + etag_ = s; + return s; + } + } + /** + *
+     * The entity tag which represents the specific version of data.
+     * ETag format is defined by the corresponding data store.
+     * 
+ * + * string etag = 2; + * @return The bytes for etag. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 3; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateResponse_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata which will be sent to app.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!data_.isEmpty()) { + output.writeBytes(1, data_); + } + if (!getEtagBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, etag_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 3); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, data_); + } + if (!getEtagBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, etag_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.GetStateResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.GetStateResponse other = (spec.proto.runtime.v1.RuntimeProto.GetStateResponse) obj; + + if (!getData() + .equals(other.getData())) return false; + if (!getEtag() + .equals(other.getEtag())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse 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 spec.proto.runtime.v1.RuntimeProto.GetStateResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse 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 spec.proto.runtime.v1.RuntimeProto.GetStateResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse 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(spec.proto.runtime.v1.RuntimeProto.GetStateResponse 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; + } + /** + *
+     * GetStateResponse is the response conveying the state value and etag.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.GetStateResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.GetStateResponse) + spec.proto.runtime.v1.RuntimeProto.GetStateResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.GetStateResponse.class, spec.proto.runtime.v1.RuntimeProto.GetStateResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.GetStateResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + data_ = com.google.protobuf.ByteString.EMPTY; + + etag_ = ""; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_GetStateResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetStateResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.GetStateResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetStateResponse build() { + spec.proto.runtime.v1.RuntimeProto.GetStateResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetStateResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.GetStateResponse result = new spec.proto.runtime.v1.RuntimeProto.GetStateResponse(this); + int from_bitField0_ = bitField0_; + result.data_ = data_; + result.etag_ = etag_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.GetStateResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.GetStateResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.GetStateResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.GetStateResponse.getDefaultInstance()) return this; + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + if (!other.getEtag().isEmpty()) { + etag_ = other.etag_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.GetStateResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.GetStateResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The byte array data
+       * 
+ * + * bytes data = 1; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+       * The byte array data
+       * 
+ * + * bytes data = 1; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
+       * The byte array data
+       * 
+ * + * bytes data = 1; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private java.lang.Object etag_ = ""; + /** + *
+       * The entity tag which represents the specific version of data.
+       * ETag format is defined by the corresponding data store.
+       * 
+ * + * string etag = 2; + * @return The etag. + */ + public java.lang.String getEtag() { + java.lang.Object ref = etag_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + etag_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The entity tag which represents the specific version of data.
+       * ETag format is defined by the corresponding data store.
+       * 
+ * + * string etag = 2; + * @return The bytes for etag. + */ + public com.google.protobuf.ByteString + getEtagBytes() { + java.lang.Object ref = etag_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + etag_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The entity tag which represents the specific version of data.
+       * ETag format is defined by the corresponding data store.
+       * 
+ * + * string etag = 2; + * @param value The etag to set. + * @return This builder for chaining. + */ + public Builder setEtag( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + etag_ = value; + onChanged(); + return this; + } + /** + *
+       * The entity tag which represents the specific version of data.
+       * ETag format is defined by the corresponding data store.
+       * 
+ * + * string etag = 2; + * @return This builder for chaining. + */ + public Builder clearEtag() { + + etag_ = getDefaultInstance().getEtag(); + onChanged(); + return this; + } + /** + *
+       * The entity tag which represents the specific version of data.
+       * ETag format is defined by the corresponding data store.
+       * 
+ * + * string etag = 2; + * @param value The bytes for etag to set. + * @return This builder for chaining. + */ + public Builder setEtagBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + etag_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 3; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata which will be sent to app.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.GetStateResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.GetStateResponse) + private static final spec.proto.runtime.v1.RuntimeProto.GetStateResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.GetStateResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.GetStateResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public GetStateResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new GetStateResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.GetStateResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeleteStateRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.DeleteStateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * Required. The key of the desired state
+     * 
+ * + * string key = 2; + * @return The key. + */ + java.lang.String getKey(); + /** + *
+     * Required. The key of the desired state
+     * 
+ * + * string key = 2; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return Whether the etag field is set. + */ + boolean hasEtag(); + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return The etag. + */ + spec.proto.runtime.v1.RuntimeProto.Etag getEtag(); + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder getEtagOrBuilder(); + + /** + *
+     * (optional) State operation options which includes concurrency/
+     * consistency/retry_policy.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + * @return Whether the options field is set. + */ + boolean hasOptions(); + /** + *
+     * (optional) State operation options which includes concurrency/
+     * consistency/retry_policy.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + * @return The options. + */ + spec.proto.runtime.v1.RuntimeProto.StateOptions getOptions(); + /** + *
+     * (optional) State operation options which includes concurrency/
+     * consistency/retry_policy.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + */ + spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder getOptionsOrBuilder(); + + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 5; + */ + int getMetadataCount(); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 5; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 5; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 5; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 5; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * DeleteStateRequest is the message to delete key-value states in the specific state store.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.DeleteStateRequest} + */ + public static final class DeleteStateRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.DeleteStateRequest) + DeleteStateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteStateRequest.newBuilder() to construct. + private DeleteStateRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteStateRequest() { + storeName_ = ""; + key_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteStateRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteStateRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 26: { + spec.proto.runtime.v1.RuntimeProto.Etag.Builder subBuilder = null; + if (etag_ != null) { + subBuilder = etag_.toBuilder(); + } + etag_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.Etag.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(etag_); + etag_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder subBuilder = null; + if (options_ != null) { + subBuilder = options_.toBuilder(); + } + options_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.StateOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(options_); + options_ = subBuilder.buildPartial(); + } + + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteStateRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest.class, spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int KEY_FIELD_NUMBER = 2; + private volatile java.lang.Object key_; + /** + *
+     * Required. The key of the desired state
+     * 
+ * + * string key = 2; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + *
+     * Required. The key of the desired state
+     * 
+ * + * string key = 2; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int ETAG_FIELD_NUMBER = 3; + private spec.proto.runtime.v1.RuntimeProto.Etag etag_; + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return Whether the etag field is set. + */ + @java.lang.Override + public boolean hasEtag() { + return etag_ != null; + } + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return The etag. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.Etag getEtag() { + return etag_ == null ? spec.proto.runtime.v1.RuntimeProto.Etag.getDefaultInstance() : etag_; + } + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder getEtagOrBuilder() { + return getEtag(); + } + + public static final int OPTIONS_FIELD_NUMBER = 4; + private spec.proto.runtime.v1.RuntimeProto.StateOptions options_; + /** + *
+     * (optional) State operation options which includes concurrency/
+     * consistency/retry_policy.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + * @return Whether the options field is set. + */ + @java.lang.Override + public boolean hasOptions() { + return options_ != null; + } + /** + *
+     * (optional) State operation options which includes concurrency/
+     * consistency/retry_policy.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + * @return The options. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptions getOptions() { + return options_ == null ? spec.proto.runtime.v1.RuntimeProto.StateOptions.getDefaultInstance() : options_; + } + /** + *
+     * (optional) State operation options which includes concurrency/
+     * consistency/retry_policy.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder getOptionsOrBuilder() { + return getOptions(); + } + + public static final int METADATA_FIELD_NUMBER = 5; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteStateRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 5; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * (optional) The metadata which will be sent to state store components.
+     * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + if (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, key_); + } + if (etag_ != null) { + output.writeMessage(3, getEtag()); + } + if (options_ != null) { + output.writeMessage(4, getOptions()); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 5); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, key_); + } + if (etag_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getEtag()); + } + if (options_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, getOptions()); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest other = (spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getKey() + .equals(other.getKey())) return false; + if (hasEtag() != other.hasEtag()) return false; + if (hasEtag()) { + if (!getEtag() + .equals(other.getEtag())) return false; + } + if (hasOptions() != other.hasOptions()) return false; + if (hasOptions()) { + if (!getOptions() + .equals(other.getOptions())) return false; + } + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + hash = (37 * hash) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + if (hasEtag()) { + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + } + if (hasOptions()) { + hash = (37 * hash) + OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getOptions().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest 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 spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest 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 spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest 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(spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest 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; + } + /** + *
+     * DeleteStateRequest is the message to delete key-value states in the specific state store.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.DeleteStateRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.DeleteStateRequest) + spec.proto.runtime.v1.RuntimeProto.DeleteStateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteStateRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest.class, spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + key_ = ""; + + if (etagBuilder_ == null) { + etag_ = null; + } else { + etag_ = null; + etagBuilder_ = null; + } + if (optionsBuilder_ == null) { + options_ = null; + } else { + options_ = null; + optionsBuilder_ = null; + } + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteStateRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest build() { + spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest result = new spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + result.key_ = key_; + if (etagBuilder_ == null) { + result.etag_ = etag_; + } else { + result.etag_ = etagBuilder_.build(); + } + if (optionsBuilder_ == null) { + result.options_ = options_; + } else { + result.options_ = optionsBuilder_.build(); + } + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.hasEtag()) { + mergeEtag(other.getEtag()); + } + if (other.hasOptions()) { + mergeOptions(other.getOptions()); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.lang.Object key_ = ""; + /** + *
+       * Required. The key of the desired state
+       * 
+ * + * string key = 2; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The key of the desired state
+       * 
+ * + * string key = 2; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The key of the desired state
+       * 
+ * + * string key = 2; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The key of the desired state
+       * 
+ * + * string key = 2; + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + *
+       * Required. The key of the desired state
+       * 
+ * + * string key = 2; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.Etag etag_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.Etag, spec.proto.runtime.v1.RuntimeProto.Etag.Builder, spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder> etagBuilder_; + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return Whether the etag field is set. + */ + public boolean hasEtag() { + return etagBuilder_ != null || etag_ != null; + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return The etag. + */ + public spec.proto.runtime.v1.RuntimeProto.Etag getEtag() { + if (etagBuilder_ == null) { + return etag_ == null ? spec.proto.runtime.v1.RuntimeProto.Etag.getDefaultInstance() : etag_; + } else { + return etagBuilder_.getMessage(); + } + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public Builder setEtag(spec.proto.runtime.v1.RuntimeProto.Etag value) { + if (etagBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + onChanged(); + } else { + etagBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public Builder setEtag( + spec.proto.runtime.v1.RuntimeProto.Etag.Builder builderForValue) { + if (etagBuilder_ == null) { + etag_ = builderForValue.build(); + onChanged(); + } else { + etagBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public Builder mergeEtag(spec.proto.runtime.v1.RuntimeProto.Etag value) { + if (etagBuilder_ == null) { + if (etag_ != null) { + etag_ = + spec.proto.runtime.v1.RuntimeProto.Etag.newBuilder(etag_).mergeFrom(value).buildPartial(); + } else { + etag_ = value; + } + onChanged(); + } else { + etagBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public Builder clearEtag() { + if (etagBuilder_ == null) { + etag_ = null; + onChanged(); + } else { + etag_ = null; + etagBuilder_ = null; + } + + return this; + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.Etag.Builder getEtagBuilder() { + + onChanged(); + return getEtagFieldBuilder().getBuilder(); + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder getEtagOrBuilder() { + if (etagBuilder_ != null) { + return etagBuilder_.getMessageOrBuilder(); + } else { + return etag_ == null ? + spec.proto.runtime.v1.RuntimeProto.Etag.getDefaultInstance() : etag_; + } + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.Etag, spec.proto.runtime.v1.RuntimeProto.Etag.Builder, spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder> + getEtagFieldBuilder() { + if (etagBuilder_ == null) { + etagBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.Etag, spec.proto.runtime.v1.RuntimeProto.Etag.Builder, spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder>( + getEtag(), + getParentForChildren(), + isClean()); + etag_ = null; + } + return etagBuilder_; + } + + private spec.proto.runtime.v1.RuntimeProto.StateOptions options_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateOptions, spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder, spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder> optionsBuilder_; + /** + *
+       * (optional) State operation options which includes concurrency/
+       * consistency/retry_policy.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + * @return Whether the options field is set. + */ + public boolean hasOptions() { + return optionsBuilder_ != null || options_ != null; + } + /** + *
+       * (optional) State operation options which includes concurrency/
+       * consistency/retry_policy.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + * @return The options. + */ + public spec.proto.runtime.v1.RuntimeProto.StateOptions getOptions() { + if (optionsBuilder_ == null) { + return options_ == null ? spec.proto.runtime.v1.RuntimeProto.StateOptions.getDefaultInstance() : options_; + } else { + return optionsBuilder_.getMessage(); + } + } + /** + *
+       * (optional) State operation options which includes concurrency/
+       * consistency/retry_policy.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + */ + public Builder setOptions(spec.proto.runtime.v1.RuntimeProto.StateOptions value) { + if (optionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + options_ = value; + onChanged(); + } else { + optionsBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * (optional) State operation options which includes concurrency/
+       * consistency/retry_policy.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + */ + public Builder setOptions( + spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder builderForValue) { + if (optionsBuilder_ == null) { + options_ = builderForValue.build(); + onChanged(); + } else { + optionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * (optional) State operation options which includes concurrency/
+       * consistency/retry_policy.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + */ + public Builder mergeOptions(spec.proto.runtime.v1.RuntimeProto.StateOptions value) { + if (optionsBuilder_ == null) { + if (options_ != null) { + options_ = + spec.proto.runtime.v1.RuntimeProto.StateOptions.newBuilder(options_).mergeFrom(value).buildPartial(); + } else { + options_ = value; + } + onChanged(); + } else { + optionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * (optional) State operation options which includes concurrency/
+       * consistency/retry_policy.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + */ + public Builder clearOptions() { + if (optionsBuilder_ == null) { + options_ = null; + onChanged(); + } else { + options_ = null; + optionsBuilder_ = null; + } + + return this; + } + /** + *
+       * (optional) State operation options which includes concurrency/
+       * consistency/retry_policy.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + */ + public spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder getOptionsBuilder() { + + onChanged(); + return getOptionsFieldBuilder().getBuilder(); + } + /** + *
+       * (optional) State operation options which includes concurrency/
+       * consistency/retry_policy.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + */ + public spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder getOptionsOrBuilder() { + if (optionsBuilder_ != null) { + return optionsBuilder_.getMessageOrBuilder(); + } else { + return options_ == null ? + spec.proto.runtime.v1.RuntimeProto.StateOptions.getDefaultInstance() : options_; + } + } + /** + *
+       * (optional) State operation options which includes concurrency/
+       * consistency/retry_policy.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 4; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateOptions, spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder, spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder> + getOptionsFieldBuilder() { + if (optionsBuilder_ == null) { + optionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateOptions, spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder, spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder>( + getOptions(), + getParentForChildren(), + isClean()); + options_ = null; + } + return optionsBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 5; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 5; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 5; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * (optional) The metadata which will be sent to state store components.
+       * 
+ * + * map<string, string> metadata = 5; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.DeleteStateRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.DeleteStateRequest) + private static final spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteStateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteStateRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteStateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface DeleteBulkStateRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.DeleteBulkStateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + java.util.List + getStatesList(); + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + spec.proto.runtime.v1.RuntimeProto.StateItem getStates(int index); + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + int getStatesCount(); + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + java.util.List + getStatesOrBuilderList(); + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder getStatesOrBuilder( + int index); + } + /** + *
+   * DeleteBulkStateRequest is the message to delete a list of key-value states from specific state store.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.DeleteBulkStateRequest} + */ + public static final class DeleteBulkStateRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.DeleteBulkStateRequest) + DeleteBulkStateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use DeleteBulkStateRequest.newBuilder() to construct. + private DeleteBulkStateRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private DeleteBulkStateRequest() { + storeName_ = ""; + states_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new DeleteBulkStateRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private DeleteBulkStateRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + states_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + states_.add( + input.readMessage(spec.proto.runtime.v1.RuntimeProto.StateItem.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + states_ = java.util.Collections.unmodifiableList(states_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteBulkStateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteBulkStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest.class, spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATES_FIELD_NUMBER = 2; + private java.util.List states_; + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + @java.lang.Override + public java.util.List getStatesList() { + return states_; + } + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + @java.lang.Override + public java.util.List + getStatesOrBuilderList() { + return states_; + } + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + @java.lang.Override + public int getStatesCount() { + return states_.size(); + } + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateItem getStates(int index) { + return states_.get(index); + } + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder getStatesOrBuilder( + int index) { + return states_.get(index); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + for (int i = 0; i < states_.size(); i++) { + output.writeMessage(2, states_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + for (int i = 0; i < states_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, states_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest other = (spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getStatesList() + .equals(other.getStatesList())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + if (getStatesCount() > 0) { + hash = (37 * hash) + STATES_FIELD_NUMBER; + hash = (53 * hash) + getStatesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest 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 spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest 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 spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest 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(spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest 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; + } + /** + *
+     * DeleteBulkStateRequest is the message to delete a list of key-value states from specific state store.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.DeleteBulkStateRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.DeleteBulkStateRequest) + spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteBulkStateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteBulkStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest.class, spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getStatesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + if (statesBuilder_ == null) { + states_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + statesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_DeleteBulkStateRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest build() { + spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest result = new spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + if (statesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + states_ = java.util.Collections.unmodifiableList(states_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.states_ = states_; + } else { + result.states_ = statesBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (statesBuilder_ == null) { + if (!other.states_.isEmpty()) { + if (states_.isEmpty()) { + states_ = other.states_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStatesIsMutable(); + states_.addAll(other.states_); + } + onChanged(); + } + } else { + if (!other.states_.isEmpty()) { + if (statesBuilder_.isEmpty()) { + statesBuilder_.dispose(); + statesBuilder_ = null; + states_ = other.states_; + bitField0_ = (bitField0_ & ~0x00000001); + statesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getStatesFieldBuilder() : null; + } else { + statesBuilder_.addAllMessages(other.states_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.util.List states_ = + java.util.Collections.emptyList(); + private void ensureStatesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + states_ = new java.util.ArrayList(states_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateItem, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder, spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder> statesBuilder_; + + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public java.util.List getStatesList() { + if (statesBuilder_ == null) { + return java.util.Collections.unmodifiableList(states_); + } else { + return statesBuilder_.getMessageList(); + } + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public int getStatesCount() { + if (statesBuilder_ == null) { + return states_.size(); + } else { + return statesBuilder_.getCount(); + } + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItem getStates(int index) { + if (statesBuilder_ == null) { + return states_.get(index); + } else { + return statesBuilder_.getMessage(index); + } + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder setStates( + int index, spec.proto.runtime.v1.RuntimeProto.StateItem value) { + if (statesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatesIsMutable(); + states_.set(index, value); + onChanged(); + } else { + statesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder setStates( + int index, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder builderForValue) { + if (statesBuilder_ == null) { + ensureStatesIsMutable(); + states_.set(index, builderForValue.build()); + onChanged(); + } else { + statesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder addStates(spec.proto.runtime.v1.RuntimeProto.StateItem value) { + if (statesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatesIsMutable(); + states_.add(value); + onChanged(); + } else { + statesBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder addStates( + int index, spec.proto.runtime.v1.RuntimeProto.StateItem value) { + if (statesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatesIsMutable(); + states_.add(index, value); + onChanged(); + } else { + statesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder addStates( + spec.proto.runtime.v1.RuntimeProto.StateItem.Builder builderForValue) { + if (statesBuilder_ == null) { + ensureStatesIsMutable(); + states_.add(builderForValue.build()); + onChanged(); + } else { + statesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder addStates( + int index, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder builderForValue) { + if (statesBuilder_ == null) { + ensureStatesIsMutable(); + states_.add(index, builderForValue.build()); + onChanged(); + } else { + statesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder addAllStates( + java.lang.Iterable values) { + if (statesBuilder_ == null) { + ensureStatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, states_); + onChanged(); + } else { + statesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder clearStates() { + if (statesBuilder_ == null) { + states_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + statesBuilder_.clear(); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder removeStates(int index) { + if (statesBuilder_ == null) { + ensureStatesIsMutable(); + states_.remove(index); + onChanged(); + } else { + statesBuilder_.remove(index); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItem.Builder getStatesBuilder( + int index) { + return getStatesFieldBuilder().getBuilder(index); + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder getStatesOrBuilder( + int index) { + if (statesBuilder_ == null) { + return states_.get(index); } else { + return statesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public java.util.List + getStatesOrBuilderList() { + if (statesBuilder_ != null) { + return statesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(states_); + } + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItem.Builder addStatesBuilder() { + return getStatesFieldBuilder().addBuilder( + spec.proto.runtime.v1.RuntimeProto.StateItem.getDefaultInstance()); + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItem.Builder addStatesBuilder( + int index) { + return getStatesFieldBuilder().addBuilder( + index, spec.proto.runtime.v1.RuntimeProto.StateItem.getDefaultInstance()); + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public java.util.List + getStatesBuilderList() { + return getStatesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateItem, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder, spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder> + getStatesFieldBuilder() { + if (statesBuilder_ == null) { + statesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateItem, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder, spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder>( + states_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + states_ = null; + } + return statesBuilder_; + } + @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:spec.proto.runtime.v1.DeleteBulkStateRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.DeleteBulkStateRequest) + private static final spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public DeleteBulkStateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new DeleteBulkStateRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.DeleteBulkStateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface SaveStateRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.SaveStateRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + java.util.List + getStatesList(); + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + spec.proto.runtime.v1.RuntimeProto.StateItem getStates(int index); + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + int getStatesCount(); + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + java.util.List + getStatesOrBuilderList(); + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder getStatesOrBuilder( + int index); + } + /** + *
+   * SaveStateRequest is the message to save multiple states into state store.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.SaveStateRequest} + */ + public static final class SaveStateRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.SaveStateRequest) + SaveStateRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use SaveStateRequest.newBuilder() to construct. + private SaveStateRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private SaveStateRequest() { + storeName_ = ""; + states_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new SaveStateRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private SaveStateRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + states_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + states_.add( + input.readMessage(spec.proto.runtime.v1.RuntimeProto.StateItem.parser(), extensionRegistry)); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + states_ = java.util.Collections.unmodifiableList(states_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveStateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SaveStateRequest.class, spec.proto.runtime.v1.RuntimeProto.SaveStateRequest.Builder.class); + } + + public static final int STORE_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * Required. The name of state store.
+     * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int STATES_FIELD_NUMBER = 2; + private java.util.List states_; + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + @java.lang.Override + public java.util.List getStatesList() { + return states_; + } + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + @java.lang.Override + public java.util.List + getStatesOrBuilderList() { + return states_; + } + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + @java.lang.Override + public int getStatesCount() { + return states_.size(); + } + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateItem getStates(int index) { + return states_.get(index); + } + /** + *
+     * Required. The array of the state key values.
+     * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder getStatesOrBuilder( + int index) { + return states_.get(index); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + for (int i = 0; i < states_.size(); i++) { + output.writeMessage(2, states_.get(i)); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + for (int i = 0; i < states_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, states_.get(i)); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.SaveStateRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.SaveStateRequest other = (spec.proto.runtime.v1.RuntimeProto.SaveStateRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getStatesList() + .equals(other.getStatesList())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORE_NAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + if (getStatesCount() > 0) { + hash = (37 * hash) + STATES_FIELD_NUMBER; + hash = (53 * hash) + getStatesList().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest 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 spec.proto.runtime.v1.RuntimeProto.SaveStateRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest 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 spec.proto.runtime.v1.RuntimeProto.SaveStateRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest 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(spec.proto.runtime.v1.RuntimeProto.SaveStateRequest 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; + } + /** + *
+     * SaveStateRequest is the message to save multiple states into state store.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.SaveStateRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.SaveStateRequest) + spec.proto.runtime.v1.RuntimeProto.SaveStateRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveStateRequest_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveStateRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.SaveStateRequest.class, spec.proto.runtime.v1.RuntimeProto.SaveStateRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.SaveStateRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getStatesFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + if (statesBuilder_ == null) { + states_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + statesBuilder_.clear(); + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_SaveStateRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SaveStateRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.SaveStateRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SaveStateRequest build() { + spec.proto.runtime.v1.RuntimeProto.SaveStateRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SaveStateRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.SaveStateRequest result = new spec.proto.runtime.v1.RuntimeProto.SaveStateRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + if (statesBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + states_ = java.util.Collections.unmodifiableList(states_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.states_ = states_; + } else { + result.states_ = statesBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.SaveStateRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.SaveStateRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.SaveStateRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.SaveStateRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (statesBuilder_ == null) { + if (!other.states_.isEmpty()) { + if (states_.isEmpty()) { + states_ = other.states_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureStatesIsMutable(); + states_.addAll(other.states_); + } + onChanged(); + } + } else { + if (!other.states_.isEmpty()) { + if (statesBuilder_.isEmpty()) { + statesBuilder_.dispose(); + statesBuilder_ = null; + states_ = other.states_; + bitField0_ = (bitField0_ & ~0x00000001); + statesBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getStatesFieldBuilder() : null; + } else { + statesBuilder_.addAllMessages(other.states_); + } + } + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.SaveStateRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.SaveStateRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * Required. The name of state store.
+       * 
+ * + * string store_name = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.util.List states_ = + java.util.Collections.emptyList(); + private void ensureStatesIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + states_ = new java.util.ArrayList(states_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateItem, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder, spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder> statesBuilder_; + + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public java.util.List getStatesList() { + if (statesBuilder_ == null) { + return java.util.Collections.unmodifiableList(states_); + } else { + return statesBuilder_.getMessageList(); + } + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public int getStatesCount() { + if (statesBuilder_ == null) { + return states_.size(); + } else { + return statesBuilder_.getCount(); + } + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItem getStates(int index) { + if (statesBuilder_ == null) { + return states_.get(index); + } else { + return statesBuilder_.getMessage(index); + } + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder setStates( + int index, spec.proto.runtime.v1.RuntimeProto.StateItem value) { + if (statesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatesIsMutable(); + states_.set(index, value); + onChanged(); + } else { + statesBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder setStates( + int index, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder builderForValue) { + if (statesBuilder_ == null) { + ensureStatesIsMutable(); + states_.set(index, builderForValue.build()); + onChanged(); + } else { + statesBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder addStates(spec.proto.runtime.v1.RuntimeProto.StateItem value) { + if (statesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatesIsMutable(); + states_.add(value); + onChanged(); + } else { + statesBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder addStates( + int index, spec.proto.runtime.v1.RuntimeProto.StateItem value) { + if (statesBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureStatesIsMutable(); + states_.add(index, value); + onChanged(); + } else { + statesBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder addStates( + spec.proto.runtime.v1.RuntimeProto.StateItem.Builder builderForValue) { + if (statesBuilder_ == null) { + ensureStatesIsMutable(); + states_.add(builderForValue.build()); + onChanged(); + } else { + statesBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder addStates( + int index, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder builderForValue) { + if (statesBuilder_ == null) { + ensureStatesIsMutable(); + states_.add(index, builderForValue.build()); + onChanged(); + } else { + statesBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder addAllStates( + java.lang.Iterable values) { + if (statesBuilder_ == null) { + ensureStatesIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, states_); + onChanged(); + } else { + statesBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder clearStates() { + if (statesBuilder_ == null) { + states_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + statesBuilder_.clear(); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public Builder removeStates(int index) { + if (statesBuilder_ == null) { + ensureStatesIsMutable(); + states_.remove(index); + onChanged(); + } else { + statesBuilder_.remove(index); + } + return this; + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItem.Builder getStatesBuilder( + int index) { + return getStatesFieldBuilder().getBuilder(index); + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder getStatesOrBuilder( + int index) { + if (statesBuilder_ == null) { + return states_.get(index); } else { + return statesBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public java.util.List + getStatesOrBuilderList() { + if (statesBuilder_ != null) { + return statesBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(states_); + } + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItem.Builder addStatesBuilder() { + return getStatesFieldBuilder().addBuilder( + spec.proto.runtime.v1.RuntimeProto.StateItem.getDefaultInstance()); + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItem.Builder addStatesBuilder( + int index) { + return getStatesFieldBuilder().addBuilder( + index, spec.proto.runtime.v1.RuntimeProto.StateItem.getDefaultInstance()); + } + /** + *
+       * Required. The array of the state key values.
+       * 
+ * + * repeated .spec.proto.runtime.v1.StateItem states = 2; + */ + public java.util.List + getStatesBuilderList() { + return getStatesFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateItem, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder, spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder> + getStatesFieldBuilder() { + if (statesBuilder_ == null) { + statesBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateItem, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder, spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder>( + states_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + states_ = null; + } + return statesBuilder_; + } + @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:spec.proto.runtime.v1.SaveStateRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.SaveStateRequest) + private static final spec.proto.runtime.v1.RuntimeProto.SaveStateRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.SaveStateRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.SaveStateRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public SaveStateRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new SaveStateRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.SaveStateRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface StateItemOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.StateItem) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. The state key
+     * 
+ * + * string key = 1; + * @return The key. + */ + java.lang.String getKey(); + /** + *
+     * Required. The state key
+     * 
+ * + * string key = 1; + * @return The bytes for key. + */ + com.google.protobuf.ByteString + getKeyBytes(); + + /** + *
+     * Required. The state data for key
+     * 
+ * + * bytes value = 2; + * @return The value. + */ + com.google.protobuf.ByteString getValue(); + + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return Whether the etag field is set. + */ + boolean hasEtag(); + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return The etag. + */ + spec.proto.runtime.v1.RuntimeProto.Etag getEtag(); + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder getEtagOrBuilder(); + + /** + *
+     * (optional) additional key-value pairs to be passed to the state store.
+     * 
+ * + * map<string, string> metadata = 4; + */ + int getMetadataCount(); + /** + *
+     * (optional) additional key-value pairs to be passed to the state store.
+     * 
+ * + * map<string, string> metadata = 4; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * (optional) additional key-value pairs to be passed to the state store.
+     * 
+ * + * map<string, string> metadata = 4; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * (optional) additional key-value pairs to be passed to the state store.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * (optional) additional key-value pairs to be passed to the state store.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + + /** + *
+     * (optional) Options for concurrency and consistency to save the state.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + * @return Whether the options field is set. + */ + boolean hasOptions(); + /** + *
+     * (optional) Options for concurrency and consistency to save the state.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + * @return The options. + */ + spec.proto.runtime.v1.RuntimeProto.StateOptions getOptions(); + /** + *
+     * (optional) Options for concurrency and consistency to save the state.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + */ + spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder getOptionsOrBuilder(); + } + /** + *
+   * StateItem represents state key, value, and additional options to save state.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.StateItem} + */ + public static final class StateItem extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.StateItem) + StateItemOrBuilder { + private static final long serialVersionUID = 0L; + // Use StateItem.newBuilder() to construct. + private StateItem(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StateItem() { + key_ = ""; + value_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StateItem(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StateItem( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + key_ = s; + break; + } + case 18: { + + value_ = input.readBytes(); + break; + } + case 26: { + spec.proto.runtime.v1.RuntimeProto.Etag.Builder subBuilder = null; + if (etag_ != null) { + subBuilder = etag_.toBuilder(); + } + etag_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.Etag.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(etag_); + etag_ = subBuilder.buildPartial(); + } + + break; + } + case 34: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + case 42: { + spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder subBuilder = null; + if (options_ != null) { + subBuilder = options_.toBuilder(); + } + options_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.StateOptions.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(options_); + options_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateItem_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.StateItem.class, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder.class); + } + + public static final int KEY_FIELD_NUMBER = 1; + private volatile java.lang.Object key_; + /** + *
+     * Required. The state key
+     * 
+ * + * string key = 1; + * @return The key. + */ + @java.lang.Override + public java.lang.String getKey() { + java.lang.Object ref = key_; + 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(); + key_ = s; + return s; + } + } + /** + *
+     * Required. The state key
+     * 
+ * + * string key = 1; + * @return The bytes for key. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int VALUE_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString value_; + /** + *
+     * Required. The state data for key
+     * 
+ * + * bytes value = 2; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + + public static final int ETAG_FIELD_NUMBER = 3; + private spec.proto.runtime.v1.RuntimeProto.Etag etag_; + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return Whether the etag field is set. + */ + @java.lang.Override + public boolean hasEtag() { + return etag_ != null; + } + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return The etag. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.Etag getEtag() { + return etag_ == null ? spec.proto.runtime.v1.RuntimeProto.Etag.getDefaultInstance() : etag_; + } + /** + *
+     * (optional) The entity tag which represents the specific version of data.
+     * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+     * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder getEtagOrBuilder() { + return getEtag(); + } + + public static final int METADATA_FIELD_NUMBER = 4; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateItem_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * (optional) additional key-value pairs to be passed to the state store.
+     * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * (optional) additional key-value pairs to be passed to the state store.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * (optional) additional key-value pairs to be passed to the state store.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * (optional) additional key-value pairs to be passed to the state store.
+     * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int OPTIONS_FIELD_NUMBER = 5; + private spec.proto.runtime.v1.RuntimeProto.StateOptions options_; + /** + *
+     * (optional) Options for concurrency and consistency to save the state.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + * @return Whether the options field is set. + */ + @java.lang.Override + public boolean hasOptions() { + return options_ != null; + } + /** + *
+     * (optional) Options for concurrency and consistency to save the state.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + * @return The options. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptions getOptions() { + return options_ == null ? spec.proto.runtime.v1.RuntimeProto.StateOptions.getDefaultInstance() : options_; + } + /** + *
+     * (optional) Options for concurrency and consistency to save the state.
+     * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder getOptionsOrBuilder() { + return getOptions(); + } + + 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 (!getKeyBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, key_); + } + if (!value_.isEmpty()) { + output.writeBytes(2, value_); + } + if (etag_ != null) { + output.writeMessage(3, getEtag()); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 4); + if (options_ != null) { + output.writeMessage(5, getOptions()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getKeyBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, key_); + } + if (!value_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, value_); + } + if (etag_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, getEtag()); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(4, metadata__); + } + if (options_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, getOptions()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.StateItem)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.StateItem other = (spec.proto.runtime.v1.RuntimeProto.StateItem) obj; + + if (!getKey() + .equals(other.getKey())) return false; + if (!getValue() + .equals(other.getValue())) return false; + if (hasEtag() != other.hasEtag()) return false; + if (hasEtag()) { + if (!getEtag() + .equals(other.getEtag())) return false; + } + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (hasOptions() != other.hasOptions()) return false; + if (hasOptions()) { + if (!getOptions() + .equals(other.getOptions())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + KEY_FIELD_NUMBER; + hash = (53 * hash) + getKey().hashCode(); + hash = (37 * hash) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + if (hasEtag()) { + hash = (37 * hash) + ETAG_FIELD_NUMBER; + hash = (53 * hash) + getEtag().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + if (hasOptions()) { + hash = (37 * hash) + OPTIONS_FIELD_NUMBER; + hash = (53 * hash) + getOptions().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.StateItem parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.StateItem parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.StateItem parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.StateItem parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.StateItem parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.StateItem parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.StateItem parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.StateItem 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 spec.proto.runtime.v1.RuntimeProto.StateItem parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.StateItem 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 spec.proto.runtime.v1.RuntimeProto.StateItem parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.StateItem 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(spec.proto.runtime.v1.RuntimeProto.StateItem 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; + } + /** + *
+     * StateItem represents state key, value, and additional options to save state.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.StateItem} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.StateItem) + spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateItem_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 4: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 4: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateItem_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.StateItem.class, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.StateItem.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + key_ = ""; + + value_ = com.google.protobuf.ByteString.EMPTY; + + if (etagBuilder_ == null) { + etag_ = null; + } else { + etag_ = null; + etagBuilder_ = null; + } + internalGetMutableMetadata().clear(); + if (optionsBuilder_ == null) { + options_ = null; + } else { + options_ = null; + optionsBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateItem_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateItem getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.StateItem.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateItem build() { + spec.proto.runtime.v1.RuntimeProto.StateItem result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateItem buildPartial() { + spec.proto.runtime.v1.RuntimeProto.StateItem result = new spec.proto.runtime.v1.RuntimeProto.StateItem(this); + int from_bitField0_ = bitField0_; + result.key_ = key_; + result.value_ = value_; + if (etagBuilder_ == null) { + result.etag_ = etag_; + } else { + result.etag_ = etagBuilder_.build(); + } + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + if (optionsBuilder_ == null) { + result.options_ = options_; + } else { + result.options_ = optionsBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.StateItem) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.StateItem)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.StateItem other) { + if (other == spec.proto.runtime.v1.RuntimeProto.StateItem.getDefaultInstance()) return this; + if (!other.getKey().isEmpty()) { + key_ = other.key_; + onChanged(); + } + if (other.getValue() != com.google.protobuf.ByteString.EMPTY) { + setValue(other.getValue()); + } + if (other.hasEtag()) { + mergeEtag(other.getEtag()); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + if (other.hasOptions()) { + mergeOptions(other.getOptions()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.StateItem parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.StateItem) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object key_ = ""; + /** + *
+       * Required. The state key
+       * 
+ * + * string key = 1; + * @return The key. + */ + public java.lang.String getKey() { + java.lang.Object ref = key_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + key_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The state key
+       * 
+ * + * string key = 1; + * @return The bytes for key. + */ + public com.google.protobuf.ByteString + getKeyBytes() { + java.lang.Object ref = key_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + key_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The state key
+       * 
+ * + * string key = 1; + * @param value The key to set. + * @return This builder for chaining. + */ + public Builder setKey( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + key_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The state key
+       * 
+ * + * string key = 1; + * @return This builder for chaining. + */ + public Builder clearKey() { + + key_ = getDefaultInstance().getKey(); + onChanged(); + return this; + } + /** + *
+       * Required. The state key
+       * 
+ * + * string key = 1; + * @param value The bytes for key to set. + * @return This builder for chaining. + */ + public Builder setKeyBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + key_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString value_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * Required. The state data for key
+       * 
+ * + * bytes value = 2; + * @return The value. + */ + @java.lang.Override + public com.google.protobuf.ByteString getValue() { + return value_; + } + /** + *
+       * Required. The state data for key
+       * 
+ * + * bytes value = 2; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The state data for key
+       * 
+ * + * bytes value = 2; + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.Etag etag_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.Etag, spec.proto.runtime.v1.RuntimeProto.Etag.Builder, spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder> etagBuilder_; + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return Whether the etag field is set. + */ + public boolean hasEtag() { + return etagBuilder_ != null || etag_ != null; + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + * @return The etag. + */ + public spec.proto.runtime.v1.RuntimeProto.Etag getEtag() { + if (etagBuilder_ == null) { + return etag_ == null ? spec.proto.runtime.v1.RuntimeProto.Etag.getDefaultInstance() : etag_; + } else { + return etagBuilder_.getMessage(); + } + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public Builder setEtag(spec.proto.runtime.v1.RuntimeProto.Etag value) { + if (etagBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + etag_ = value; + onChanged(); + } else { + etagBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public Builder setEtag( + spec.proto.runtime.v1.RuntimeProto.Etag.Builder builderForValue) { + if (etagBuilder_ == null) { + etag_ = builderForValue.build(); + onChanged(); + } else { + etagBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public Builder mergeEtag(spec.proto.runtime.v1.RuntimeProto.Etag value) { + if (etagBuilder_ == null) { + if (etag_ != null) { + etag_ = + spec.proto.runtime.v1.RuntimeProto.Etag.newBuilder(etag_).mergeFrom(value).buildPartial(); + } else { + etag_ = value; + } + onChanged(); + } else { + etagBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public Builder clearEtag() { + if (etagBuilder_ == null) { + etag_ = null; + onChanged(); + } else { + etag_ = null; + etagBuilder_ = null; + } + + return this; + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.Etag.Builder getEtagBuilder() { + + onChanged(); + return getEtagFieldBuilder().getBuilder(); + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + public spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder getEtagOrBuilder() { + if (etagBuilder_ != null) { + return etagBuilder_.getMessageOrBuilder(); + } else { + return etag_ == null ? + spec.proto.runtime.v1.RuntimeProto.Etag.getDefaultInstance() : etag_; + } + } + /** + *
+       * (optional) The entity tag which represents the specific version of data.
+       * The exact ETag format is defined by the corresponding data store. Layotto runtime only treats ETags as opaque strings.
+       * 
+ * + * .spec.proto.runtime.v1.Etag etag = 3; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.Etag, spec.proto.runtime.v1.RuntimeProto.Etag.Builder, spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder> + getEtagFieldBuilder() { + if (etagBuilder_ == null) { + etagBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.Etag, spec.proto.runtime.v1.RuntimeProto.Etag.Builder, spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder>( + getEtag(), + getParentForChildren(), + isClean()); + etag_ = null; + } + return etagBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * (optional) additional key-value pairs to be passed to the state store.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * (optional) additional key-value pairs to be passed to the state store.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * (optional) additional key-value pairs to be passed to the state store.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * (optional) additional key-value pairs to be passed to the state store.
+       * 
+ * + * map<string, string> metadata = 4; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * (optional) additional key-value pairs to be passed to the state store.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * (optional) additional key-value pairs to be passed to the state store.
+       * 
+ * + * map<string, string> metadata = 4; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * (optional) additional key-value pairs to be passed to the state store.
+       * 
+ * + * map<string, string> metadata = 4; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.StateOptions options_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateOptions, spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder, spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder> optionsBuilder_; + /** + *
+       * (optional) Options for concurrency and consistency to save the state.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + * @return Whether the options field is set. + */ + public boolean hasOptions() { + return optionsBuilder_ != null || options_ != null; + } + /** + *
+       * (optional) Options for concurrency and consistency to save the state.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + * @return The options. + */ + public spec.proto.runtime.v1.RuntimeProto.StateOptions getOptions() { + if (optionsBuilder_ == null) { + return options_ == null ? spec.proto.runtime.v1.RuntimeProto.StateOptions.getDefaultInstance() : options_; + } else { + return optionsBuilder_.getMessage(); + } + } + /** + *
+       * (optional) Options for concurrency and consistency to save the state.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + */ + public Builder setOptions(spec.proto.runtime.v1.RuntimeProto.StateOptions value) { + if (optionsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + options_ = value; + onChanged(); + } else { + optionsBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * (optional) Options for concurrency and consistency to save the state.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + */ + public Builder setOptions( + spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder builderForValue) { + if (optionsBuilder_ == null) { + options_ = builderForValue.build(); + onChanged(); + } else { + optionsBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * (optional) Options for concurrency and consistency to save the state.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + */ + public Builder mergeOptions(spec.proto.runtime.v1.RuntimeProto.StateOptions value) { + if (optionsBuilder_ == null) { + if (options_ != null) { + options_ = + spec.proto.runtime.v1.RuntimeProto.StateOptions.newBuilder(options_).mergeFrom(value).buildPartial(); + } else { + options_ = value; + } + onChanged(); + } else { + optionsBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * (optional) Options for concurrency and consistency to save the state.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + */ + public Builder clearOptions() { + if (optionsBuilder_ == null) { + options_ = null; + onChanged(); + } else { + options_ = null; + optionsBuilder_ = null; + } + + return this; + } + /** + *
+       * (optional) Options for concurrency and consistency to save the state.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + */ + public spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder getOptionsBuilder() { + + onChanged(); + return getOptionsFieldBuilder().getBuilder(); + } + /** + *
+       * (optional) Options for concurrency and consistency to save the state.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + */ + public spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder getOptionsOrBuilder() { + if (optionsBuilder_ != null) { + return optionsBuilder_.getMessageOrBuilder(); + } else { + return options_ == null ? + spec.proto.runtime.v1.RuntimeProto.StateOptions.getDefaultInstance() : options_; + } + } + /** + *
+       * (optional) Options for concurrency and consistency to save the state.
+       * 
+ * + * .spec.proto.runtime.v1.StateOptions options = 5; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateOptions, spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder, spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder> + getOptionsFieldBuilder() { + if (optionsBuilder_ == null) { + optionsBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateOptions, spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder, spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder>( + getOptions(), + getParentForChildren(), + isClean()); + options_ = null; + } + return optionsBuilder_; + } + @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:spec.proto.runtime.v1.StateItem) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.StateItem) + private static final spec.proto.runtime.v1.RuntimeProto.StateItem DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.StateItem(); + } + + public static spec.proto.runtime.v1.RuntimeProto.StateItem getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StateItem parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StateItem(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateItem getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface EtagOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.Etag) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * value sets the etag value
+     * 
+ * + * string value = 1; + * @return The value. + */ + java.lang.String getValue(); + /** + *
+     * value sets the etag value
+     * 
+ * + * string value = 1; + * @return The bytes for value. + */ + com.google.protobuf.ByteString + getValueBytes(); + } + /** + *
+   * Etag represents a state item version
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.Etag} + */ + public static final class Etag extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.Etag) + EtagOrBuilder { + private static final long serialVersionUID = 0L; + // Use Etag.newBuilder() to construct. + private Etag(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Etag() { + value_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Etag(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private Etag( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + value_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_Etag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_Etag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.Etag.class, spec.proto.runtime.v1.RuntimeProto.Etag.Builder.class); + } + + public static final int VALUE_FIELD_NUMBER = 1; + private volatile java.lang.Object value_; + /** + *
+     * value sets the etag value
+     * 
+ * + * string value = 1; + * @return The value. + */ + @java.lang.Override + public java.lang.String getValue() { + java.lang.Object ref = value_; + 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(); + value_ = s; + return s; + } + } + /** + *
+     * value sets the etag value
+     * 
+ * + * string value = 1; + * @return The bytes for value. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = 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 (!getValueBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, value_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getValueBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, value_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.Etag)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.Etag other = (spec.proto.runtime.v1.RuntimeProto.Etag) obj; + + if (!getValue() + .equals(other.getValue())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + VALUE_FIELD_NUMBER; + hash = (53 * hash) + getValue().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.Etag parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.Etag parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.Etag parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.Etag parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.Etag parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.Etag parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.Etag parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.Etag 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 spec.proto.runtime.v1.RuntimeProto.Etag parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.Etag 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 spec.proto.runtime.v1.RuntimeProto.Etag parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.Etag 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(spec.proto.runtime.v1.RuntimeProto.Etag 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; + } + /** + *
+     * Etag represents a state item version
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.Etag} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.Etag) + spec.proto.runtime.v1.RuntimeProto.EtagOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_Etag_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_Etag_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.Etag.class, spec.proto.runtime.v1.RuntimeProto.Etag.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.Etag.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + value_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_Etag_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.Etag getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.Etag.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.Etag build() { + spec.proto.runtime.v1.RuntimeProto.Etag result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.Etag buildPartial() { + spec.proto.runtime.v1.RuntimeProto.Etag result = new spec.proto.runtime.v1.RuntimeProto.Etag(this); + result.value_ = value_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.Etag) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.Etag)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.Etag other) { + if (other == spec.proto.runtime.v1.RuntimeProto.Etag.getDefaultInstance()) return this; + if (!other.getValue().isEmpty()) { + value_ = other.value_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.Etag parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.Etag) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object value_ = ""; + /** + *
+       * value sets the etag value
+       * 
+ * + * string value = 1; + * @return The value. + */ + public java.lang.String getValue() { + java.lang.Object ref = value_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + value_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * value sets the etag value
+       * 
+ * + * string value = 1; + * @return The bytes for value. + */ + public com.google.protobuf.ByteString + getValueBytes() { + java.lang.Object ref = value_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + value_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * value sets the etag value
+       * 
+ * + * string value = 1; + * @param value The value to set. + * @return This builder for chaining. + */ + public Builder setValue( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + value_ = value; + onChanged(); + return this; + } + /** + *
+       * value sets the etag value
+       * 
+ * + * string value = 1; + * @return This builder for chaining. + */ + public Builder clearValue() { + + value_ = getDefaultInstance().getValue(); + onChanged(); + return this; + } + /** + *
+       * value sets the etag value
+       * 
+ * + * string value = 1; + * @param value The bytes for value to set. + * @return This builder for chaining. + */ + public Builder setValueBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + value_ = value; + 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:spec.proto.runtime.v1.Etag) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.Etag) + private static final spec.proto.runtime.v1.RuntimeProto.Etag DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.Etag(); + } + + public static spec.proto.runtime.v1.RuntimeProto.Etag getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Etag parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new Etag(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.Etag getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface StateOptionsOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.StateOptions) + com.google.protobuf.MessageOrBuilder { + + /** + * .spec.proto.runtime.v1.StateOptions.StateConcurrency concurrency = 1; + * @return The enum numeric value on the wire for concurrency. + */ + int getConcurrencyValue(); + /** + * .spec.proto.runtime.v1.StateOptions.StateConcurrency concurrency = 1; + * @return The concurrency. + */ + spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency getConcurrency(); + + /** + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 2; + * @return The enum numeric value on the wire for consistency. + */ + int getConsistencyValue(); + /** + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 2; + * @return The consistency. + */ + spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency getConsistency(); + } + /** + *
+   * StateOptions configures concurrency and consistency for state operations
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.StateOptions} + */ + public static final class StateOptions extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.StateOptions) + StateOptionsOrBuilder { + private static final long serialVersionUID = 0L; + // Use StateOptions.newBuilder() to construct. + private StateOptions(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StateOptions() { + concurrency_ = 0; + consistency_ = 0; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StateOptions(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private StateOptions( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int rawValue = input.readEnum(); + + concurrency_ = rawValue; + break; + } + case 16: { + int rawValue = input.readEnum(); + + consistency_ = rawValue; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.StateOptions.class, spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder.class); + } + + /** + *
+     * Enum describing the supported concurrency for state.
+     * The API server uses Optimized Concurrency Control (OCC) with ETags.
+     * When an ETag is associated with an save or delete request, the store shall allow the update only if the attached ETag matches with the latest ETag in the database.
+     * But when ETag is missing in the write requests, the state store shall handle the requests in the specified strategy(e.g. a last-write-wins fashion).
+     * 
+ * + * Protobuf enum {@code spec.proto.runtime.v1.StateOptions.StateConcurrency} + */ + public enum StateConcurrency + implements com.google.protobuf.ProtocolMessageEnum { + /** + * CONCURRENCY_UNSPECIFIED = 0; + */ + CONCURRENCY_UNSPECIFIED(0), + /** + *
+       * First write wins
+       * 
+ * + * CONCURRENCY_FIRST_WRITE = 1; + */ + CONCURRENCY_FIRST_WRITE(1), + /** + *
+       * Last write wins
+       * 
+ * + * CONCURRENCY_LAST_WRITE = 2; + */ + CONCURRENCY_LAST_WRITE(2), + UNRECOGNIZED(-1), + ; + + /** + * CONCURRENCY_UNSPECIFIED = 0; + */ + public static final int CONCURRENCY_UNSPECIFIED_VALUE = 0; + /** + *
+       * First write wins
+       * 
+ * + * CONCURRENCY_FIRST_WRITE = 1; + */ + public static final int CONCURRENCY_FIRST_WRITE_VALUE = 1; + /** + *
+       * Last write wins
+       * 
+ * + * CONCURRENCY_LAST_WRITE = 2; + */ + public static final int CONCURRENCY_LAST_WRITE_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 StateConcurrency 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 StateConcurrency forNumber(int value) { + switch (value) { + case 0: return CONCURRENCY_UNSPECIFIED; + case 1: return CONCURRENCY_FIRST_WRITE; + case 2: return CONCURRENCY_LAST_WRITE; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + StateConcurrency> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public StateConcurrency findValueByNumber(int number) { + return StateConcurrency.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 spec.proto.runtime.v1.RuntimeProto.StateOptions.getDescriptor().getEnumTypes().get(0); + } + + private static final StateConcurrency[] VALUES = values(); + + public static StateConcurrency 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 StateConcurrency(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:spec.proto.runtime.v1.StateOptions.StateConcurrency) + } + + /** + *
+     * Enum describing the supported consistency for state.
+     * 
+ * + * Protobuf enum {@code spec.proto.runtime.v1.StateOptions.StateConsistency} + */ + public enum StateConsistency + implements com.google.protobuf.ProtocolMessageEnum { + /** + * CONSISTENCY_UNSPECIFIED = 0; + */ + CONSISTENCY_UNSPECIFIED(0), + /** + *
+       *  The API server assumes data stores are eventually consistent by default.A state store should:
+       * - For read requests, the state store can return data from any of the replicas
+       * - For write request, the state store should asynchronously replicate updates to configured quorum after acknowledging the update request.
+       * 
+ * + * CONSISTENCY_EVENTUAL = 1; + */ + CONSISTENCY_EVENTUAL(1), + /** + *
+       * When a strong consistency hint is attached, a state store should:
+       * - For read requests, the state store should return the most up-to-date data consistently across replicas.
+       * - For write/delete requests, the state store should synchronisely replicate updated data to configured quorum before completing the write request.
+       * 
+ * + * CONSISTENCY_STRONG = 2; + */ + CONSISTENCY_STRONG(2), + UNRECOGNIZED(-1), + ; + + /** + * CONSISTENCY_UNSPECIFIED = 0; + */ + public static final int CONSISTENCY_UNSPECIFIED_VALUE = 0; + /** + *
+       *  The API server assumes data stores are eventually consistent by default.A state store should:
+       * - For read requests, the state store can return data from any of the replicas
+       * - For write request, the state store should asynchronously replicate updates to configured quorum after acknowledging the update request.
+       * 
+ * + * CONSISTENCY_EVENTUAL = 1; + */ + public static final int CONSISTENCY_EVENTUAL_VALUE = 1; + /** + *
+       * When a strong consistency hint is attached, a state store should:
+       * - For read requests, the state store should return the most up-to-date data consistently across replicas.
+       * - For write/delete requests, the state store should synchronisely replicate updated data to configured quorum before completing the write request.
+       * 
+ * + * CONSISTENCY_STRONG = 2; + */ + public static final int CONSISTENCY_STRONG_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 StateConsistency 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 StateConsistency forNumber(int value) { + switch (value) { + case 0: return CONSISTENCY_UNSPECIFIED; + case 1: return CONSISTENCY_EVENTUAL; + case 2: return CONSISTENCY_STRONG; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + StateConsistency> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public StateConsistency findValueByNumber(int number) { + return StateConsistency.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 spec.proto.runtime.v1.RuntimeProto.StateOptions.getDescriptor().getEnumTypes().get(1); + } + + private static final StateConsistency[] VALUES = values(); + + public static StateConsistency 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 StateConsistency(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:spec.proto.runtime.v1.StateOptions.StateConsistency) + } + + public static final int CONCURRENCY_FIELD_NUMBER = 1; + private int concurrency_; + /** + * .spec.proto.runtime.v1.StateOptions.StateConcurrency concurrency = 1; + * @return The enum numeric value on the wire for concurrency. + */ + @java.lang.Override public int getConcurrencyValue() { + return concurrency_; + } + /** + * .spec.proto.runtime.v1.StateOptions.StateConcurrency concurrency = 1; + * @return The concurrency. + */ + @java.lang.Override public spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency getConcurrency() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency result = spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency.valueOf(concurrency_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency.UNRECOGNIZED : result; + } + + public static final int CONSISTENCY_FIELD_NUMBER = 2; + private int consistency_; + /** + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 2; + * @return The enum numeric value on the wire for consistency. + */ + @java.lang.Override public int getConsistencyValue() { + return consistency_; + } + /** + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 2; + * @return The consistency. + */ + @java.lang.Override public spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency getConsistency() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency result = spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.valueOf(consistency_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.UNRECOGNIZED : result; + } + + 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 (concurrency_ != spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency.CONCURRENCY_UNSPECIFIED.getNumber()) { + output.writeEnum(1, concurrency_); + } + if (consistency_ != spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.CONSISTENCY_UNSPECIFIED.getNumber()) { + output.writeEnum(2, consistency_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (concurrency_ != spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency.CONCURRENCY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(1, concurrency_); + } + if (consistency_ != spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.CONSISTENCY_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(2, consistency_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.StateOptions)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.StateOptions other = (spec.proto.runtime.v1.RuntimeProto.StateOptions) obj; + + if (concurrency_ != other.concurrency_) return false; + if (consistency_ != other.consistency_) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + CONCURRENCY_FIELD_NUMBER; + hash = (53 * hash) + concurrency_; + hash = (37 * hash) + CONSISTENCY_FIELD_NUMBER; + hash = (53 * hash) + consistency_; + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.StateOptions parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.StateOptions parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.StateOptions parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.StateOptions parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.StateOptions parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.StateOptions parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.StateOptions parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.StateOptions 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 spec.proto.runtime.v1.RuntimeProto.StateOptions parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.StateOptions 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 spec.proto.runtime.v1.RuntimeProto.StateOptions parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.StateOptions 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(spec.proto.runtime.v1.RuntimeProto.StateOptions 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; + } + /** + *
+     * StateOptions configures concurrency and consistency for state operations
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.StateOptions} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.StateOptions) + spec.proto.runtime.v1.RuntimeProto.StateOptionsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateOptions_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateOptions_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.StateOptions.class, spec.proto.runtime.v1.RuntimeProto.StateOptions.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.StateOptions.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + concurrency_ = 0; + + consistency_ = 0; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_StateOptions_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptions getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.StateOptions.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptions build() { + spec.proto.runtime.v1.RuntimeProto.StateOptions result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptions buildPartial() { + spec.proto.runtime.v1.RuntimeProto.StateOptions result = new spec.proto.runtime.v1.RuntimeProto.StateOptions(this); + result.concurrency_ = concurrency_; + result.consistency_ = consistency_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.StateOptions) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.StateOptions)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.StateOptions other) { + if (other == spec.proto.runtime.v1.RuntimeProto.StateOptions.getDefaultInstance()) return this; + if (other.concurrency_ != 0) { + setConcurrencyValue(other.getConcurrencyValue()); + } + if (other.consistency_ != 0) { + setConsistencyValue(other.getConsistencyValue()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.StateOptions parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.StateOptions) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private int concurrency_ = 0; + /** + * .spec.proto.runtime.v1.StateOptions.StateConcurrency concurrency = 1; + * @return The enum numeric value on the wire for concurrency. + */ + @java.lang.Override public int getConcurrencyValue() { + return concurrency_; + } + /** + * .spec.proto.runtime.v1.StateOptions.StateConcurrency concurrency = 1; + * @param value The enum numeric value on the wire for concurrency to set. + * @return This builder for chaining. + */ + public Builder setConcurrencyValue(int value) { + + concurrency_ = value; + onChanged(); + return this; + } + /** + * .spec.proto.runtime.v1.StateOptions.StateConcurrency concurrency = 1; + * @return The concurrency. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency getConcurrency() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency result = spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency.valueOf(concurrency_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency.UNRECOGNIZED : result; + } + /** + * .spec.proto.runtime.v1.StateOptions.StateConcurrency concurrency = 1; + * @param value The concurrency to set. + * @return This builder for chaining. + */ + public Builder setConcurrency(spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConcurrency value) { + if (value == null) { + throw new NullPointerException(); + } + + concurrency_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .spec.proto.runtime.v1.StateOptions.StateConcurrency concurrency = 1; + * @return This builder for chaining. + */ + public Builder clearConcurrency() { + + concurrency_ = 0; + onChanged(); + return this; + } + + private int consistency_ = 0; + /** + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 2; + * @return The enum numeric value on the wire for consistency. + */ + @java.lang.Override public int getConsistencyValue() { + return consistency_; + } + /** + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 2; + * @param value The enum numeric value on the wire for consistency to set. + * @return This builder for chaining. + */ + public Builder setConsistencyValue(int value) { + + consistency_ = value; + onChanged(); + return this; + } + /** + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 2; + * @return The consistency. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency getConsistency() { + @SuppressWarnings("deprecation") + spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency result = spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.valueOf(consistency_); + return result == null ? spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency.UNRECOGNIZED : result; + } + /** + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 2; + * @param value The consistency to set. + * @return This builder for chaining. + */ + public Builder setConsistency(spec.proto.runtime.v1.RuntimeProto.StateOptions.StateConsistency value) { + if (value == null) { + throw new NullPointerException(); + } + + consistency_ = value.getNumber(); + onChanged(); + return this; + } + /** + * .spec.proto.runtime.v1.StateOptions.StateConsistency consistency = 2; + * @return This builder for chaining. + */ + public Builder clearConsistency() { + + consistency_ = 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:spec.proto.runtime.v1.StateOptions) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.StateOptions) + private static final spec.proto.runtime.v1.RuntimeProto.StateOptions DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.StateOptions(); + } + + public static spec.proto.runtime.v1.RuntimeProto.StateOptions getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StateOptions parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new StateOptions(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateOptions getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface TransactionalStateOperationOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.TransactionalStateOperation) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. The type of operation to be executed.
+     * Legal values include:
+     * "upsert" represents an update or create operation
+     * "delete" represents a delete operation
+     * 
+ * + * string operationType = 1; + * @return The operationType. + */ + java.lang.String getOperationType(); + /** + *
+     * Required. The type of operation to be executed.
+     * Legal values include:
+     * "upsert" represents an update or create operation
+     * "delete" represents a delete operation
+     * 
+ * + * string operationType = 1; + * @return The bytes for operationType. + */ + com.google.protobuf.ByteString + getOperationTypeBytes(); + + /** + *
+     * Required. State values to be operated on
+     * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + * @return Whether the request field is set. + */ + boolean hasRequest(); + /** + *
+     * Required. State values to be operated on
+     * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + * @return The request. + */ + spec.proto.runtime.v1.RuntimeProto.StateItem getRequest(); + /** + *
+     * Required. State values to be operated on
+     * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + */ + spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder getRequestOrBuilder(); + } + /** + *
+   * TransactionalStateOperation is the message to execute a specified operation with a key-value pair.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.TransactionalStateOperation} + */ + public static final class TransactionalStateOperation extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.TransactionalStateOperation) + TransactionalStateOperationOrBuilder { + private static final long serialVersionUID = 0L; + // Use TransactionalStateOperation.newBuilder() to construct. + private TransactionalStateOperation(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private TransactionalStateOperation() { + operationType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new TransactionalStateOperation(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private TransactionalStateOperation( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + operationType_ = s; + break; + } + case 18: { + spec.proto.runtime.v1.RuntimeProto.StateItem.Builder subBuilder = null; + if (request_ != null) { + subBuilder = request_.toBuilder(); + } + request_ = input.readMessage(spec.proto.runtime.v1.RuntimeProto.StateItem.parser(), extensionRegistry); + if (subBuilder != null) { + subBuilder.mergeFrom(request_); + request_ = subBuilder.buildPartial(); + } + + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TransactionalStateOperation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TransactionalStateOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.class, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder.class); + } + + public static final int OPERATIONTYPE_FIELD_NUMBER = 1; + private volatile java.lang.Object operationType_; + /** + *
+     * Required. The type of operation to be executed.
+     * Legal values include:
+     * "upsert" represents an update or create operation
+     * "delete" represents a delete operation
+     * 
+ * + * string operationType = 1; + * @return The operationType. + */ + @java.lang.Override + public java.lang.String getOperationType() { + java.lang.Object ref = operationType_; + 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(); + operationType_ = s; + return s; + } + } + /** + *
+     * Required. The type of operation to be executed.
+     * Legal values include:
+     * "upsert" represents an update or create operation
+     * "delete" represents a delete operation
+     * 
+ * + * string operationType = 1; + * @return The bytes for operationType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOperationTypeBytes() { + java.lang.Object ref = operationType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + operationType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int REQUEST_FIELD_NUMBER = 2; + private spec.proto.runtime.v1.RuntimeProto.StateItem request_; + /** + *
+     * Required. State values to be operated on
+     * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + * @return Whether the request field is set. + */ + @java.lang.Override + public boolean hasRequest() { + return request_ != null; + } + /** + *
+     * Required. State values to be operated on
+     * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + * @return The request. + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateItem getRequest() { + return request_ == null ? spec.proto.runtime.v1.RuntimeProto.StateItem.getDefaultInstance() : request_; + } + /** + *
+     * Required. State values to be operated on
+     * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder getRequestOrBuilder() { + return getRequest(); + } + + 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 (!getOperationTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, operationType_); + } + if (request_ != null) { + output.writeMessage(2, getRequest()); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getOperationTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, operationType_); + } + if (request_ != null) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, getRequest()); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation other = (spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation) obj; + + if (!getOperationType() + .equals(other.getOperationType())) return false; + if (hasRequest() != other.hasRequest()) return false; + if (hasRequest()) { + if (!getRequest() + .equals(other.getRequest())) return false; + } + if (!unknownFields.equals(other.unknownFields)) 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) + OPERATIONTYPE_FIELD_NUMBER; + hash = (53 * hash) + getOperationType().hashCode(); + if (hasRequest()) { + hash = (37 * hash) + REQUEST_FIELD_NUMBER; + hash = (53 * hash) + getRequest().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation 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 spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation 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 spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation 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(spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation 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; + } + /** + *
+     * TransactionalStateOperation is the message to execute a specified operation with a key-value pair.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.TransactionalStateOperation} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.TransactionalStateOperation) + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperationOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TransactionalStateOperation_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TransactionalStateOperation_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.class, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + operationType_ = ""; + + if (requestBuilder_ == null) { + request_ = null; + } else { + request_ = null; + requestBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_TransactionalStateOperation_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation build() { + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation buildPartial() { + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation result = new spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation(this); + result.operationType_ = operationType_; + if (requestBuilder_ == null) { + result.request_ = request_; + } else { + result.request_ = requestBuilder_.build(); + } + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation other) { + if (other == spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.getDefaultInstance()) return this; + if (!other.getOperationType().isEmpty()) { + operationType_ = other.operationType_; + onChanged(); + } + if (other.hasRequest()) { + mergeRequest(other.getRequest()); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + + private java.lang.Object operationType_ = ""; + /** + *
+       * Required. The type of operation to be executed.
+       * Legal values include:
+       * "upsert" represents an update or create operation
+       * "delete" represents a delete operation
+       * 
+ * + * string operationType = 1; + * @return The operationType. + */ + public java.lang.String getOperationType() { + java.lang.Object ref = operationType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operationType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. The type of operation to be executed.
+       * Legal values include:
+       * "upsert" represents an update or create operation
+       * "delete" represents a delete operation
+       * 
+ * + * string operationType = 1; + * @return The bytes for operationType. + */ + public com.google.protobuf.ByteString + getOperationTypeBytes() { + java.lang.Object ref = operationType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + operationType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. The type of operation to be executed.
+       * Legal values include:
+       * "upsert" represents an update or create operation
+       * "delete" represents a delete operation
+       * 
+ * + * string operationType = 1; + * @param value The operationType to set. + * @return This builder for chaining. + */ + public Builder setOperationType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operationType_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. The type of operation to be executed.
+       * Legal values include:
+       * "upsert" represents an update or create operation
+       * "delete" represents a delete operation
+       * 
+ * + * string operationType = 1; + * @return This builder for chaining. + */ + public Builder clearOperationType() { + + operationType_ = getDefaultInstance().getOperationType(); + onChanged(); + return this; + } + /** + *
+       * Required. The type of operation to be executed.
+       * Legal values include:
+       * "upsert" represents an update or create operation
+       * "delete" represents a delete operation
+       * 
+ * + * string operationType = 1; + * @param value The bytes for operationType to set. + * @return This builder for chaining. + */ + public Builder setOperationTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operationType_ = value; + onChanged(); + return this; + } + + private spec.proto.runtime.v1.RuntimeProto.StateItem request_; + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateItem, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder, spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder> requestBuilder_; + /** + *
+       * Required. State values to be operated on
+       * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + * @return Whether the request field is set. + */ + public boolean hasRequest() { + return requestBuilder_ != null || request_ != null; + } + /** + *
+       * Required. State values to be operated on
+       * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + * @return The request. + */ + public spec.proto.runtime.v1.RuntimeProto.StateItem getRequest() { + if (requestBuilder_ == null) { + return request_ == null ? spec.proto.runtime.v1.RuntimeProto.StateItem.getDefaultInstance() : request_; + } else { + return requestBuilder_.getMessage(); + } + } + /** + *
+       * Required. State values to be operated on
+       * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + */ + public Builder setRequest(spec.proto.runtime.v1.RuntimeProto.StateItem value) { + if (requestBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + request_ = value; + onChanged(); + } else { + requestBuilder_.setMessage(value); + } + + return this; + } + /** + *
+       * Required. State values to be operated on
+       * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + */ + public Builder setRequest( + spec.proto.runtime.v1.RuntimeProto.StateItem.Builder builderForValue) { + if (requestBuilder_ == null) { + request_ = builderForValue.build(); + onChanged(); + } else { + requestBuilder_.setMessage(builderForValue.build()); + } + + return this; + } + /** + *
+       * Required. State values to be operated on
+       * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + */ + public Builder mergeRequest(spec.proto.runtime.v1.RuntimeProto.StateItem value) { + if (requestBuilder_ == null) { + if (request_ != null) { + request_ = + spec.proto.runtime.v1.RuntimeProto.StateItem.newBuilder(request_).mergeFrom(value).buildPartial(); + } else { + request_ = value; + } + onChanged(); + } else { + requestBuilder_.mergeFrom(value); + } + + return this; + } + /** + *
+       * Required. State values to be operated on
+       * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + */ + public Builder clearRequest() { + if (requestBuilder_ == null) { + request_ = null; + onChanged(); + } else { + request_ = null; + requestBuilder_ = null; + } + + return this; + } + /** + *
+       * Required. State values to be operated on
+       * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItem.Builder getRequestBuilder() { + + onChanged(); + return getRequestFieldBuilder().getBuilder(); + } + /** + *
+       * Required. State values to be operated on
+       * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder getRequestOrBuilder() { + if (requestBuilder_ != null) { + return requestBuilder_.getMessageOrBuilder(); + } else { + return request_ == null ? + spec.proto.runtime.v1.RuntimeProto.StateItem.getDefaultInstance() : request_; + } + } + /** + *
+       * Required. State values to be operated on
+       * 
+ * + * .spec.proto.runtime.v1.StateItem request = 2; + */ + private com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateItem, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder, spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder> + getRequestFieldBuilder() { + if (requestBuilder_ == null) { + requestBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.StateItem, spec.proto.runtime.v1.RuntimeProto.StateItem.Builder, spec.proto.runtime.v1.RuntimeProto.StateItemOrBuilder>( + getRequest(), + getParentForChildren(), + isClean()); + request_ = null; + } + return requestBuilder_; + } + @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:spec.proto.runtime.v1.TransactionalStateOperation) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.TransactionalStateOperation) + private static final spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation(); + } + + public static spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public TransactionalStateOperation parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new TransactionalStateOperation(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface ExecuteStateTransactionRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.ExecuteStateTransactionRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * Required. name of state store.
+     * 
+ * + * string storeName = 1; + * @return The storeName. + */ + java.lang.String getStoreName(); + /** + *
+     * Required. name of state store.
+     * 
+ * + * string storeName = 1; + * @return The bytes for storeName. + */ + com.google.protobuf.ByteString + getStoreNameBytes(); + + /** + *
+     * Required. transactional operation list.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + java.util.List + getOperationsList(); + /** + *
+     * Required. transactional operation list.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation getOperations(int index); + /** + *
+     * Required. transactional operation list.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + int getOperationsCount(); + /** + *
+     * Required. transactional operation list.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + java.util.List + getOperationsOrBuilderList(); + /** + *
+     * Required. transactional operation list.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperationOrBuilder getOperationsOrBuilder( + int index); + + /** + *
+     * (optional) The metadata used for transactional operations.
+     * 
+ * + * map<string, string> metadata = 3; + */ + int getMetadataCount(); + /** + *
+     * (optional) The metadata used for transactional operations.
+     * 
+ * + * map<string, string> metadata = 3; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * (optional) The metadata used for transactional operations.
+     * 
+ * + * map<string, string> metadata = 3; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * (optional) The metadata used for transactional operations.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * (optional) The metadata used for transactional operations.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * ExecuteStateTransactionRequest is the message to execute multiple operations on a specified store.
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.ExecuteStateTransactionRequest} + */ + public static final class ExecuteStateTransactionRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.ExecuteStateTransactionRequest) + ExecuteStateTransactionRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use ExecuteStateTransactionRequest.newBuilder() to construct. + private ExecuteStateTransactionRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private ExecuteStateTransactionRequest() { + storeName_ = ""; + operations_ = java.util.Collections.emptyList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new ExecuteStateTransactionRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private ExecuteStateTransactionRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + storeName_ = s; + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + operations_ = new java.util.ArrayList(); + mutable_bitField0_ |= 0x00000001; + } + operations_.add( + input.readMessage(spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.parser(), extensionRegistry)); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000002) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000002; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + if (((mutable_bitField0_ & 0x00000001) != 0)) { + operations_ = java.util.Collections.unmodifiableList(operations_); + } + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest.class, spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest.Builder.class); + } + + public static final int STORENAME_FIELD_NUMBER = 1; + private volatile java.lang.Object storeName_; + /** + *
+     * Required. name of state store.
+     * 
+ * + * string storeName = 1; + * @return The storeName. + */ + @java.lang.Override + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + 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(); + storeName_ = s; + return s; + } + } + /** + *
+     * Required. name of state store.
+     * 
+ * + * string storeName = 1; + * @return The bytes for storeName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int OPERATIONS_FIELD_NUMBER = 2; + private java.util.List operations_; + /** + *
+     * Required. transactional operation list.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + @java.lang.Override + public java.util.List getOperationsList() { + return operations_; + } + /** + *
+     * Required. transactional operation list.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + @java.lang.Override + public java.util.List + getOperationsOrBuilderList() { + return operations_; + } + /** + *
+     * Required. transactional operation list.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + @java.lang.Override + public int getOperationsCount() { + return operations_.size(); + } + /** + *
+     * Required. transactional operation list.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation getOperations(int index) { + return operations_.get(index); + } + /** + *
+     * Required. transactional operation list.
+     * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperationOrBuilder getOperationsOrBuilder( + int index) { + return operations_.get(index); + } + + public static final int METADATA_FIELD_NUMBER = 3; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * (optional) The metadata used for transactional operations.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * (optional) The metadata used for transactional operations.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * (optional) The metadata used for transactional operations.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * (optional) The metadata used for transactional operations.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getStoreNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, storeName_); + } + for (int i = 0; i < operations_.size(); i++) { + output.writeMessage(2, operations_.get(i)); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 3); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getStoreNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, storeName_); + } + for (int i = 0; i < operations_.size(); i++) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, operations_.get(i)); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest other = (spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest) obj; + + if (!getStoreName() + .equals(other.getStoreName())) return false; + if (!getOperationsList() + .equals(other.getOperationsList())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + STORENAME_FIELD_NUMBER; + hash = (53 * hash) + getStoreName().hashCode(); + if (getOperationsCount() > 0) { + hash = (37 * hash) + OPERATIONS_FIELD_NUMBER; + hash = (53 * hash) + getOperationsList().hashCode(); + } + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest 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 spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest 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 spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest 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(spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest 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; + } + /** + *
+     * ExecuteStateTransactionRequest is the message to execute multiple operations on a specified store.
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.ExecuteStateTransactionRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.ExecuteStateTransactionRequest) + spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest.class, spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getOperationsFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + storeName_ = ""; + + if (operationsBuilder_ == null) { + operations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + } else { + operationsBuilder_.clear(); + } + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest build() { + spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest result = new spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest(this); + int from_bitField0_ = bitField0_; + result.storeName_ = storeName_; + if (operationsBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0)) { + operations_ = java.util.Collections.unmodifiableList(operations_); + bitField0_ = (bitField0_ & ~0x00000001); + } + result.operations_ = operations_; + } else { + result.operations_ = operationsBuilder_.build(); + } + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest.getDefaultInstance()) return this; + if (!other.getStoreName().isEmpty()) { + storeName_ = other.storeName_; + onChanged(); + } + if (operationsBuilder_ == null) { + if (!other.operations_.isEmpty()) { + if (operations_.isEmpty()) { + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000001); + } else { + ensureOperationsIsMutable(); + operations_.addAll(other.operations_); + } + onChanged(); + } + } else { + if (!other.operations_.isEmpty()) { + if (operationsBuilder_.isEmpty()) { + operationsBuilder_.dispose(); + operationsBuilder_ = null; + operations_ = other.operations_; + bitField0_ = (bitField0_ & ~0x00000001); + operationsBuilder_ = + com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders ? + getOperationsFieldBuilder() : null; + } else { + operationsBuilder_.addAllMessages(other.operations_); + } + } + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object storeName_ = ""; + /** + *
+       * Required. name of state store.
+       * 
+ * + * string storeName = 1; + * @return The storeName. + */ + public java.lang.String getStoreName() { + java.lang.Object ref = storeName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + storeName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * Required. name of state store.
+       * 
+ * + * string storeName = 1; + * @return The bytes for storeName. + */ + public com.google.protobuf.ByteString + getStoreNameBytes() { + java.lang.Object ref = storeName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + storeName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * Required. name of state store.
+       * 
+ * + * string storeName = 1; + * @param value The storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + storeName_ = value; + onChanged(); + return this; + } + /** + *
+       * Required. name of state store.
+       * 
+ * + * string storeName = 1; + * @return This builder for chaining. + */ + public Builder clearStoreName() { + + storeName_ = getDefaultInstance().getStoreName(); + onChanged(); + return this; + } + /** + *
+       * Required. name of state store.
+       * 
+ * + * string storeName = 1; + * @param value The bytes for storeName to set. + * @return This builder for chaining. + */ + public Builder setStoreNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + storeName_ = value; + onChanged(); + return this; + } + + private java.util.List operations_ = + java.util.Collections.emptyList(); + private void ensureOperationsIsMutable() { + if (!((bitField0_ & 0x00000001) != 0)) { + operations_ = new java.util.ArrayList(operations_); + bitField0_ |= 0x00000001; + } + } + + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperationOrBuilder> operationsBuilder_; + + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public java.util.List getOperationsList() { + if (operationsBuilder_ == null) { + return java.util.Collections.unmodifiableList(operations_); + } else { + return operationsBuilder_.getMessageList(); + } + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public int getOperationsCount() { + if (operationsBuilder_ == null) { + return operations_.size(); + } else { + return operationsBuilder_.getCount(); + } + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation getOperations(int index) { + if (operationsBuilder_ == null) { + return operations_.get(index); + } else { + return operationsBuilder_.getMessage(index); + } + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public Builder setOperations( + int index, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.set(index, value); + onChanged(); + } else { + operationsBuilder_.setMessage(index, value); + } + return this; + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public Builder setOperations( + int index, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.set(index, builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.setMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public Builder addOperations(spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(value); + onChanged(); + } else { + operationsBuilder_.addMessage(value); + } + return this; + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public Builder addOperations( + int index, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation value) { + if (operationsBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + ensureOperationsIsMutable(); + operations_.add(index, value); + onChanged(); + } else { + operationsBuilder_.addMessage(index, value); + } + return this; + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public Builder addOperations( + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.add(builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.addMessage(builderForValue.build()); + } + return this; + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public Builder addOperations( + int index, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder builderForValue) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.add(index, builderForValue.build()); + onChanged(); + } else { + operationsBuilder_.addMessage(index, builderForValue.build()); + } + return this; + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public Builder addAllOperations( + java.lang.Iterable values) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, operations_); + onChanged(); + } else { + operationsBuilder_.addAllMessages(values); + } + return this; + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public Builder clearOperations() { + if (operationsBuilder_ == null) { + operations_ = java.util.Collections.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + } else { + operationsBuilder_.clear(); + } + return this; + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public Builder removeOperations(int index) { + if (operationsBuilder_ == null) { + ensureOperationsIsMutable(); + operations_.remove(index); + onChanged(); + } else { + operationsBuilder_.remove(index); + } + return this; + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder getOperationsBuilder( + int index) { + return getOperationsFieldBuilder().getBuilder(index); + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperationOrBuilder getOperationsOrBuilder( + int index) { + if (operationsBuilder_ == null) { + return operations_.get(index); } else { + return operationsBuilder_.getMessageOrBuilder(index); + } + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public java.util.List + getOperationsOrBuilderList() { + if (operationsBuilder_ != null) { + return operationsBuilder_.getMessageOrBuilderList(); + } else { + return java.util.Collections.unmodifiableList(operations_); + } + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder addOperationsBuilder() { + return getOperationsFieldBuilder().addBuilder( + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.getDefaultInstance()); + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder addOperationsBuilder( + int index) { + return getOperationsFieldBuilder().addBuilder( + index, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.getDefaultInstance()); + } + /** + *
+       * Required. transactional operation list.
+       * 
+ * + * repeated .spec.proto.runtime.v1.TransactionalStateOperation operations = 2; + */ + public java.util.List + getOperationsBuilderList() { + return getOperationsFieldBuilder().getBuilderList(); + } + private com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperationOrBuilder> + getOperationsFieldBuilder() { + if (operationsBuilder_ == null) { + operationsBuilder_ = new com.google.protobuf.RepeatedFieldBuilderV3< + spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperation.Builder, spec.proto.runtime.v1.RuntimeProto.TransactionalStateOperationOrBuilder>( + operations_, + ((bitField0_ & 0x00000001) != 0), + getParentForChildren(), + isClean()); + operations_ = null; + } + return operationsBuilder_; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * (optional) The metadata used for transactional operations.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * (optional) The metadata used for transactional operations.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * (optional) The metadata used for transactional operations.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * (optional) The metadata used for transactional operations.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * (optional) The metadata used for transactional operations.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * (optional) The metadata used for transactional operations.
+       * 
+ * + * map<string, string> metadata = 3; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * (optional) The metadata used for transactional operations.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.ExecuteStateTransactionRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.ExecuteStateTransactionRequest) + private static final spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public ExecuteStateTransactionRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new ExecuteStateTransactionRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.ExecuteStateTransactionRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface PublishEventRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.PublishEventRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The name of the pubsub component
+     * 
+ * + * string pubsub_name = 1; + * @return The pubsubName. + */ + java.lang.String getPubsubName(); + /** + *
+     * The name of the pubsub component
+     * 
+ * + * string pubsub_name = 1; + * @return The bytes for pubsubName. + */ + com.google.protobuf.ByteString + getPubsubNameBytes(); + + /** + *
+     * The pubsub topic
+     * 
+ * + * string topic = 2; + * @return The topic. + */ + java.lang.String getTopic(); + /** + *
+     * The pubsub topic
+     * 
+ * + * string topic = 2; + * @return The bytes for topic. + */ + com.google.protobuf.ByteString + getTopicBytes(); + + /** + *
+     * The data which will be published to topic.
+     * 
+ * + * bytes data = 3; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
+     * The content type for the data (optional).
+     * 
+ * + * string data_content_type = 4; + * @return The dataContentType. + */ + java.lang.String getDataContentType(); + /** + *
+     * The content type for the data (optional).
+     * 
+ * + * string data_content_type = 4; + * @return The bytes for dataContentType. + */ + com.google.protobuf.ByteString + getDataContentTypeBytes(); + + /** + *
+     * The metadata passing to pub components
+     * metadata property:
+     * - key : the key of the message.
+     * 
+ * + * map<string, string> metadata = 5; + */ + int getMetadataCount(); + /** + *
+     * The metadata passing to pub components
+     * metadata property:
+     * - key : the key of the message.
+     * 
+ * + * map<string, string> metadata = 5; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata passing to pub components
+     * metadata property:
+     * - key : the key of the message.
+     * 
+ * + * map<string, string> metadata = 5; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata passing to pub components
+     * metadata property:
+     * - key : the key of the message.
+     * 
+ * + * map<string, string> metadata = 5; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata passing to pub components
+     * metadata property:
+     * - key : the key of the message.
+     * 
+ * + * map<string, string> metadata = 5; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * PublishEventRequest is the message to publish event data to pubsub topic
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.PublishEventRequest} + */ + public static final class PublishEventRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.PublishEventRequest) + PublishEventRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use PublishEventRequest.newBuilder() to construct. + private PublishEventRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private PublishEventRequest() { + pubsubName_ = ""; + topic_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + dataContentType_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new PublishEventRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private PublishEventRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + pubsubName_ = s; + break; + } + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + + topic_ = s; + break; + } + case 26: { + + data_ = input.readBytes(); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + dataContentType_ = s; + break; + } + case 42: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PublishEventRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PublishEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.PublishEventRequest.class, spec.proto.runtime.v1.RuntimeProto.PublishEventRequest.Builder.class); + } + + public static final int PUBSUB_NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object pubsubName_; + /** + *
+     * The name of the pubsub component
+     * 
+ * + * string pubsub_name = 1; + * @return The pubsubName. + */ + @java.lang.Override + public java.lang.String getPubsubName() { + java.lang.Object ref = pubsubName_; + 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(); + pubsubName_ = s; + return s; + } + } + /** + *
+     * The name of the pubsub component
+     * 
+ * + * string pubsub_name = 1; + * @return The bytes for pubsubName. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getPubsubNameBytes() { + java.lang.Object ref = pubsubName_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pubsubName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int TOPIC_FIELD_NUMBER = 2; + private volatile java.lang.Object topic_; + /** + *
+     * The pubsub topic
+     * 
+ * + * string topic = 2; + * @return The topic. + */ + @java.lang.Override + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + 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(); + topic_ = s; + return s; + } + } + /** + *
+     * The pubsub topic
+     * 
+ * + * string topic = 2; + * @return The bytes for topic. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 3; + private com.google.protobuf.ByteString data_; + /** + *
+     * The data which will be published to topic.
+     * 
+ * + * bytes data = 3; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int DATA_CONTENT_TYPE_FIELD_NUMBER = 4; + private volatile java.lang.Object dataContentType_; + /** + *
+     * The content type for the data (optional).
+     * 
+ * + * string data_content_type = 4; + * @return The dataContentType. + */ + @java.lang.Override + public java.lang.String getDataContentType() { + java.lang.Object ref = dataContentType_; + 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(); + dataContentType_ = s; + return s; + } + } + /** + *
+     * The content type for the data (optional).
+     * 
+ * + * string data_content_type = 4; + * @return The bytes for dataContentType. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getDataContentTypeBytes() { + java.lang.Object ref = dataContentType_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dataContentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int METADATA_FIELD_NUMBER = 5; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PublishEventRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata passing to pub components
+     * metadata property:
+     * - key : the key of the message.
+     * 
+ * + * map<string, string> metadata = 5; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata passing to pub components
+     * metadata property:
+     * - key : the key of the message.
+     * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata passing to pub components
+     * metadata property:
+     * - key : the key of the message.
+     * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata passing to pub components
+     * metadata property:
+     * - key : the key of the message.
+     * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!getPubsubNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, pubsubName_); + } + if (!getTopicBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 2, topic_); + } + if (!data_.isEmpty()) { + output.writeBytes(3, data_); + } + if (!getDataContentTypeBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, dataContentType_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 5); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getPubsubNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, pubsubName_); + } + if (!getTopicBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, topic_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(3, data_); + } + if (!getDataContentTypeBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, dataContentType_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(5, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.PublishEventRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.PublishEventRequest other = (spec.proto.runtime.v1.RuntimeProto.PublishEventRequest) obj; + + if (!getPubsubName() + .equals(other.getPubsubName())) return false; + if (!getTopic() + .equals(other.getTopic())) return false; + if (!getData() + .equals(other.getData())) return false; + if (!getDataContentType() + .equals(other.getDataContentType())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + PUBSUB_NAME_FIELD_NUMBER; + hash = (53 * hash) + getPubsubName().hashCode(); + hash = (37 * hash) + TOPIC_FIELD_NUMBER; + hash = (53 * hash) + getTopic().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + hash = (37 * hash) + DATA_CONTENT_TYPE_FIELD_NUMBER; + hash = (53 * hash) + getDataContentType().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest 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 spec.proto.runtime.v1.RuntimeProto.PublishEventRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest 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 spec.proto.runtime.v1.RuntimeProto.PublishEventRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest 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(spec.proto.runtime.v1.RuntimeProto.PublishEventRequest 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; + } + /** + *
+     * PublishEventRequest is the message to publish event data to pubsub topic
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.PublishEventRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.PublishEventRequest) + spec.proto.runtime.v1.RuntimeProto.PublishEventRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PublishEventRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 5: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 5: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PublishEventRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.PublishEventRequest.class, spec.proto.runtime.v1.RuntimeProto.PublishEventRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.PublishEventRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + pubsubName_ = ""; + + topic_ = ""; + + data_ = com.google.protobuf.ByteString.EMPTY; + + dataContentType_ = ""; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_PublishEventRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.PublishEventRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.PublishEventRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.PublishEventRequest build() { + spec.proto.runtime.v1.RuntimeProto.PublishEventRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.PublishEventRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.PublishEventRequest result = new spec.proto.runtime.v1.RuntimeProto.PublishEventRequest(this); + int from_bitField0_ = bitField0_; + result.pubsubName_ = pubsubName_; + result.topic_ = topic_; + result.data_ = data_; + result.dataContentType_ = dataContentType_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.PublishEventRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.PublishEventRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.PublishEventRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.PublishEventRequest.getDefaultInstance()) return this; + if (!other.getPubsubName().isEmpty()) { + pubsubName_ = other.pubsubName_; + onChanged(); + } + if (!other.getTopic().isEmpty()) { + topic_ = other.topic_; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + if (!other.getDataContentType().isEmpty()) { + dataContentType_ = other.dataContentType_; + onChanged(); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.PublishEventRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.PublishEventRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object pubsubName_ = ""; + /** + *
+       * The name of the pubsub component
+       * 
+ * + * string pubsub_name = 1; + * @return The pubsubName. + */ + public java.lang.String getPubsubName() { + java.lang.Object ref = pubsubName_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + pubsubName_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of the pubsub component
+       * 
+ * + * string pubsub_name = 1; + * @return The bytes for pubsubName. + */ + public com.google.protobuf.ByteString + getPubsubNameBytes() { + java.lang.Object ref = pubsubName_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + pubsubName_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of the pubsub component
+       * 
+ * + * string pubsub_name = 1; + * @param value The pubsubName to set. + * @return This builder for chaining. + */ + public Builder setPubsubName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + pubsubName_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of the pubsub component
+       * 
+ * + * string pubsub_name = 1; + * @return This builder for chaining. + */ + public Builder clearPubsubName() { + + pubsubName_ = getDefaultInstance().getPubsubName(); + onChanged(); + return this; + } + /** + *
+       * The name of the pubsub component
+       * 
+ * + * string pubsub_name = 1; + * @param value The bytes for pubsubName to set. + * @return This builder for chaining. + */ + public Builder setPubsubNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + pubsubName_ = value; + onChanged(); + return this; + } + + private java.lang.Object topic_ = ""; + /** + *
+       * The pubsub topic
+       * 
+ * + * string topic = 2; + * @return The topic. + */ + public java.lang.String getTopic() { + java.lang.Object ref = topic_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + topic_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The pubsub topic
+       * 
+ * + * string topic = 2; + * @return The bytes for topic. + */ + public com.google.protobuf.ByteString + getTopicBytes() { + java.lang.Object ref = topic_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + topic_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The pubsub topic
+       * 
+ * + * string topic = 2; + * @param value The topic to set. + * @return This builder for chaining. + */ + public Builder setTopic( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + topic_ = value; + onChanged(); + return this; + } + /** + *
+       * The pubsub topic
+       * 
+ * + * string topic = 2; + * @return This builder for chaining. + */ + public Builder clearTopic() { + + topic_ = getDefaultInstance().getTopic(); + onChanged(); + return this; + } + /** + *
+       * The pubsub topic
+       * 
+ * + * string topic = 2; + * @param value The bytes for topic to set. + * @return This builder for chaining. + */ + public Builder setTopicBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + topic_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The data which will be published to topic.
+       * 
+ * + * bytes data = 3; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+       * The data which will be published to topic.
+       * 
+ * + * bytes data = 3; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
+       * The data which will be published to topic.
+       * 
+ * + * bytes data = 3; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private java.lang.Object dataContentType_ = ""; + /** + *
+       * The content type for the data (optional).
+       * 
+ * + * string data_content_type = 4; + * @return The dataContentType. + */ + public java.lang.String getDataContentType() { + java.lang.Object ref = dataContentType_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + dataContentType_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The content type for the data (optional).
+       * 
+ * + * string data_content_type = 4; + * @return The bytes for dataContentType. + */ + public com.google.protobuf.ByteString + getDataContentTypeBytes() { + java.lang.Object ref = dataContentType_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + dataContentType_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The content type for the data (optional).
+       * 
+ * + * string data_content_type = 4; + * @param value The dataContentType to set. + * @return This builder for chaining. + */ + public Builder setDataContentType( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + dataContentType_ = value; + onChanged(); + return this; + } + /** + *
+       * The content type for the data (optional).
+       * 
+ * + * string data_content_type = 4; + * @return This builder for chaining. + */ + public Builder clearDataContentType() { + + dataContentType_ = getDefaultInstance().getDataContentType(); + onChanged(); + return this; + } + /** + *
+       * The content type for the data (optional).
+       * 
+ * + * string data_content_type = 4; + * @param value The bytes for dataContentType to set. + * @return This builder for chaining. + */ + public Builder setDataContentTypeBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + dataContentType_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata passing to pub components
+       * metadata property:
+       * - key : the key of the message.
+       * 
+ * + * map<string, string> metadata = 5; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata passing to pub components
+       * metadata property:
+       * - key : the key of the message.
+       * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata passing to pub components
+       * metadata property:
+       * - key : the key of the message.
+       * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata passing to pub components
+       * metadata property:
+       * - key : the key of the message.
+       * 
+ * + * map<string, string> metadata = 5; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata passing to pub components
+       * metadata property:
+       * - key : the key of the message.
+       * 
+ * + * map<string, string> metadata = 5; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata passing to pub components
+       * metadata property:
+       * - key : the key of the message.
+       * 
+ * + * map<string, string> metadata = 5; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata passing to pub components
+       * metadata property:
+       * - key : the key of the message.
+       * 
+ * + * map<string, string> metadata = 5; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.PublishEventRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.PublishEventRequest) + private static final spec.proto.runtime.v1.RuntimeProto.PublishEventRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.PublishEventRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.PublishEventRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public PublishEventRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new PublishEventRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.PublishEventRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface InvokeBindingRequestOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.InvokeBindingRequest) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The name of the output binding to invoke.
+     * 
+ * + * string name = 1; + * @return The name. + */ + java.lang.String getName(); + /** + *
+     * The name of the output binding to invoke.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + com.google.protobuf.ByteString + getNameBytes(); + + /** + *
+     * The data which will be sent to output binding.
+     * 
+ * + * bytes data = 2; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
+     * The metadata passing to output binding components
+     * Common metadata property:
+     * - ttlInSeconds : the time to live in seconds for the message.
+     * If set in the binding definition will cause all messages to
+     * have a default time to live. The message ttl overrides any value
+     * in the binding definition.
+     * 
+ * + * map<string, string> metadata = 3; + */ + int getMetadataCount(); + /** + *
+     * The metadata passing to output binding components
+     * Common metadata property:
+     * - ttlInSeconds : the time to live in seconds for the message.
+     * If set in the binding definition will cause all messages to
+     * have a default time to live. The message ttl overrides any value
+     * in the binding definition.
+     * 
+ * + * map<string, string> metadata = 3; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata passing to output binding components
+     * Common metadata property:
+     * - ttlInSeconds : the time to live in seconds for the message.
+     * If set in the binding definition will cause all messages to
+     * have a default time to live. The message ttl overrides any value
+     * in the binding definition.
+     * 
+ * + * map<string, string> metadata = 3; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata passing to output binding components
+     * Common metadata property:
+     * - ttlInSeconds : the time to live in seconds for the message.
+     * If set in the binding definition will cause all messages to
+     * have a default time to live. The message ttl overrides any value
+     * in the binding definition.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata passing to output binding components
+     * Common metadata property:
+     * - ttlInSeconds : the time to live in seconds for the message.
+     * If set in the binding definition will cause all messages to
+     * have a default time to live. The message ttl overrides any value
+     * in the binding definition.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + + /** + *
+     * The name of the operation type for the binding to invoke
+     * 
+ * + * string operation = 4; + * @return The operation. + */ + java.lang.String getOperation(); + /** + *
+     * The name of the operation type for the binding to invoke
+     * 
+ * + * string operation = 4; + * @return The bytes for operation. + */ + com.google.protobuf.ByteString + getOperationBytes(); + } + /** + *
+   * InvokeBindingRequest is the message to send data to output bindings
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.InvokeBindingRequest} + */ + public static final class InvokeBindingRequest extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.InvokeBindingRequest) + InvokeBindingRequestOrBuilder { + private static final long serialVersionUID = 0L; + // Use InvokeBindingRequest.newBuilder() to construct. + private InvokeBindingRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private InvokeBindingRequest() { + name_ = ""; + data_ = com.google.protobuf.ByteString.EMPTY; + operation_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new InvokeBindingRequest(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private InvokeBindingRequest( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + java.lang.String s = input.readStringRequireUtf8(); + + name_ = s; + break; + } + case 18: { + + data_ = input.readBytes(); + break; + } + case 26: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + case 34: { + java.lang.String s = input.readStringRequireUtf8(); + + operation_ = s; + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest.class, spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest.Builder.class); + } + + public static final int NAME_FIELD_NUMBER = 1; + private volatile java.lang.Object name_; + /** + *
+     * The name of the output binding to invoke.
+     * 
+ * + * string name = 1; + * @return The name. + */ + @java.lang.Override + public java.lang.String getName() { + java.lang.Object ref = name_; + 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(); + name_ = s; + return s; + } + } + /** + *
+     * The name of the output binding to invoke.
+     * 
+ * + * string name = 1; + * @return The bytes for name. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int DATA_FIELD_NUMBER = 2; + private com.google.protobuf.ByteString data_; + /** + *
+     * The data which will be sent to output binding.
+     * 
+ * + * bytes data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int METADATA_FIELD_NUMBER = 3; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingRequest_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata passing to output binding components
+     * Common metadata property:
+     * - ttlInSeconds : the time to live in seconds for the message.
+     * If set in the binding definition will cause all messages to
+     * have a default time to live. The message ttl overrides any value
+     * in the binding definition.
+     * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata passing to output binding components
+     * Common metadata property:
+     * - ttlInSeconds : the time to live in seconds for the message.
+     * If set in the binding definition will cause all messages to
+     * have a default time to live. The message ttl overrides any value
+     * in the binding definition.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata passing to output binding components
+     * Common metadata property:
+     * - ttlInSeconds : the time to live in seconds for the message.
+     * If set in the binding definition will cause all messages to
+     * have a default time to live. The message ttl overrides any value
+     * in the binding definition.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata passing to output binding components
+     * Common metadata property:
+     * - ttlInSeconds : the time to live in seconds for the message.
+     * If set in the binding definition will cause all messages to
+     * have a default time to live. The message ttl overrides any value
+     * in the binding definition.
+     * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public static final int OPERATION_FIELD_NUMBER = 4; + private volatile java.lang.Object operation_; + /** + *
+     * The name of the operation type for the binding to invoke
+     * 
+ * + * string operation = 4; + * @return The operation. + */ + @java.lang.Override + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + 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(); + operation_ = s; + return s; + } + } + /** + *
+     * The name of the operation type for the binding to invoke
+     * 
+ * + * string operation = 4; + * @return The bytes for operation. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + operation_ = 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 (!getNameBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); + } + if (!data_.isEmpty()) { + output.writeBytes(2, data_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 3); + if (!getOperationBytes().isEmpty()) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 4, operation_); + } + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!getNameBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); + } + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(2, data_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(3, metadata__); + } + if (!getOperationBytes().isEmpty()) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(4, operation_); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest other = (spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest) obj; + + if (!getName() + .equals(other.getName())) return false; + if (!getData() + .equals(other.getData())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!getOperation() + .equals(other.getOperation())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + NAME_FIELD_NUMBER; + hash = (53 * hash) + getName().hashCode(); + hash = (37 * hash) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (37 * hash) + OPERATION_FIELD_NUMBER; + hash = (53 * hash) + getOperation().hashCode(); + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest 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 spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest 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 spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest 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(spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest 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; + } + /** + *
+     * InvokeBindingRequest is the message to send data to output bindings
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.InvokeBindingRequest} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.InvokeBindingRequest) + spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequestOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingRequest_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 3: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 3: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingRequest_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest.class, spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + name_ = ""; + + data_ = com.google.protobuf.ByteString.EMPTY; + + internalGetMutableMetadata().clear(); + operation_ = ""; + + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingRequest_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest build() { + spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest buildPartial() { + spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest result = new spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest(this); + int from_bitField0_ = bitField0_; + result.name_ = name_; + result.data_ = data_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + result.operation_ = operation_; + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest other) { + if (other == spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest.getDefaultInstance()) return this; + if (!other.getName().isEmpty()) { + name_ = other.name_; + onChanged(); + } + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + if (!other.getOperation().isEmpty()) { + operation_ = other.operation_; + onChanged(); + } + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private java.lang.Object name_ = ""; + /** + *
+       * The name of the output binding to invoke.
+       * 
+ * + * string name = 1; + * @return The name. + */ + public java.lang.String getName() { + java.lang.Object ref = name_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + name_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of the output binding to invoke.
+       * 
+ * + * string name = 1; + * @return The bytes for name. + */ + public com.google.protobuf.ByteString + getNameBytes() { + java.lang.Object ref = name_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + name_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of the output binding to invoke.
+       * 
+ * + * string name = 1; + * @param value The name to set. + * @return This builder for chaining. + */ + public Builder setName( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + name_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of the output binding to invoke.
+       * 
+ * + * string name = 1; + * @return This builder for chaining. + */ + public Builder clearName() { + + name_ = getDefaultInstance().getName(); + onChanged(); + return this; + } + /** + *
+       * The name of the output binding to invoke.
+       * 
+ * + * string name = 1; + * @param value The bytes for name to set. + * @return This builder for chaining. + */ + public Builder setNameBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + name_ = value; + onChanged(); + return this; + } + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The data which will be sent to output binding.
+       * 
+ * + * bytes data = 2; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+       * The data which will be sent to output binding.
+       * 
+ * + * bytes data = 2; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
+       * The data which will be sent to output binding.
+       * 
+ * + * bytes data = 2; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata passing to output binding components
+       * Common metadata property:
+       * - ttlInSeconds : the time to live in seconds for the message.
+       * If set in the binding definition will cause all messages to
+       * have a default time to live. The message ttl overrides any value
+       * in the binding definition.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata passing to output binding components
+       * Common metadata property:
+       * - ttlInSeconds : the time to live in seconds for the message.
+       * If set in the binding definition will cause all messages to
+       * have a default time to live. The message ttl overrides any value
+       * in the binding definition.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata passing to output binding components
+       * Common metadata property:
+       * - ttlInSeconds : the time to live in seconds for the message.
+       * If set in the binding definition will cause all messages to
+       * have a default time to live. The message ttl overrides any value
+       * in the binding definition.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata passing to output binding components
+       * Common metadata property:
+       * - ttlInSeconds : the time to live in seconds for the message.
+       * If set in the binding definition will cause all messages to
+       * have a default time to live. The message ttl overrides any value
+       * in the binding definition.
+       * 
+ * + * map<string, string> metadata = 3; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata passing to output binding components
+       * Common metadata property:
+       * - ttlInSeconds : the time to live in seconds for the message.
+       * If set in the binding definition will cause all messages to
+       * have a default time to live. The message ttl overrides any value
+       * in the binding definition.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata passing to output binding components
+       * Common metadata property:
+       * - ttlInSeconds : the time to live in seconds for the message.
+       * If set in the binding definition will cause all messages to
+       * have a default time to live. The message ttl overrides any value
+       * in the binding definition.
+       * 
+ * + * map<string, string> metadata = 3; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata passing to output binding components
+       * Common metadata property:
+       * - ttlInSeconds : the time to live in seconds for the message.
+       * If set in the binding definition will cause all messages to
+       * have a default time to live. The message ttl overrides any value
+       * in the binding definition.
+       * 
+ * + * map<string, string> metadata = 3; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + return this; + } + + private java.lang.Object operation_ = ""; + /** + *
+       * The name of the operation type for the binding to invoke
+       * 
+ * + * string operation = 4; + * @return The operation. + */ + public java.lang.String getOperation() { + java.lang.Object ref = operation_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + operation_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + *
+       * The name of the operation type for the binding to invoke
+       * 
+ * + * string operation = 4; + * @return The bytes for operation. + */ + public com.google.protobuf.ByteString + getOperationBytes() { + java.lang.Object ref = operation_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + operation_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + *
+       * The name of the operation type for the binding to invoke
+       * 
+ * + * string operation = 4; + * @param value The operation to set. + * @return This builder for chaining. + */ + public Builder setOperation( + java.lang.String value) { + if (value == null) { + throw new NullPointerException(); + } + + operation_ = value; + onChanged(); + return this; + } + /** + *
+       * The name of the operation type for the binding to invoke
+       * 
+ * + * string operation = 4; + * @return This builder for chaining. + */ + public Builder clearOperation() { + + operation_ = getDefaultInstance().getOperation(); + onChanged(); + return this; + } + /** + *
+       * The name of the operation type for the binding to invoke
+       * 
+ * + * string operation = 4; + * @param value The bytes for operation to set. + * @return This builder for chaining. + */ + public Builder setOperationBytes( + com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + checkByteStringIsUtf8(value); + + operation_ = value; + 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:spec.proto.runtime.v1.InvokeBindingRequest) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.InvokeBindingRequest) + private static final spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest(); + } + + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InvokeBindingRequest parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InvokeBindingRequest(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeBindingRequest getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + public interface InvokeBindingResponseOrBuilder extends + // @@protoc_insertion_point(interface_extends:spec.proto.runtime.v1.InvokeBindingResponse) + com.google.protobuf.MessageOrBuilder { + + /** + *
+     * The data which will be sent to output binding.
+     * 
+ * + * bytes data = 1; + * @return The data. + */ + com.google.protobuf.ByteString getData(); + + /** + *
+     * The metadata returned from an external system
+     * 
+ * + * map<string, string> metadata = 2; + */ + int getMetadataCount(); + /** + *
+     * The metadata returned from an external system
+     * 
+ * + * map<string, string> metadata = 2; + */ + boolean containsMetadata( + java.lang.String key); + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getMetadata(); + /** + *
+     * The metadata returned from an external system
+     * 
+ * + * map<string, string> metadata = 2; + */ + java.util.Map + getMetadataMap(); + /** + *
+     * The metadata returned from an external system
+     * 
+ * + * map<string, string> metadata = 2; + */ + + java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue); + /** + *
+     * The metadata returned from an external system
+     * 
+ * + * map<string, string> metadata = 2; + */ + + java.lang.String getMetadataOrThrow( + java.lang.String key); + } + /** + *
+   * InvokeBindingResponse is the message returned from an output binding invocation
+   * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.InvokeBindingResponse} + */ + public static final class InvokeBindingResponse extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:spec.proto.runtime.v1.InvokeBindingResponse) + InvokeBindingResponseOrBuilder { + private static final long serialVersionUID = 0L; + // Use InvokeBindingResponse.newBuilder() to construct. + private InvokeBindingResponse(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private InvokeBindingResponse() { + data_ = com.google.protobuf.ByteString.EMPTY; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new InvokeBindingResponse(); + } + + @java.lang.Override + public final com.google.protobuf.UnknownFieldSet + getUnknownFields() { + return this.unknownFields; + } + private InvokeBindingResponse( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + int mutable_bitField0_ = 0; + com.google.protobuf.UnknownFieldSet.Builder unknownFields = + com.google.protobuf.UnknownFieldSet.newBuilder(); + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + + data_ = input.readBytes(); + break; + } + case 18: { + if (!((mutable_bitField0_ & 0x00000001) != 0)) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + mutable_bitField0_ |= 0x00000001; + } + com.google.protobuf.MapEntry + metadata__ = input.readMessage( + MetadataDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + metadata_.getMutableMap().put( + metadata__.getKey(), metadata__.getValue()); + break; + } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } + } + } + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(this); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException( + e).setUnfinishedMessage(this); + } finally { + this.unknownFields = unknownFields.build(); + makeExtensionsImmutable(); + } + } + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse.class, spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse.Builder.class); + } + + public static final int DATA_FIELD_NUMBER = 1; + private com.google.protobuf.ByteString data_; + /** + *
+     * The data which will be sent to output binding.
+     * 
+ * + * bytes data = 1; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + + public static final int METADATA_FIELD_NUMBER = 2; + private static final class MetadataDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingResponse_MetadataEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+     * The metadata returned from an external system
+     * 
+ * + * map<string, string> metadata = 2; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+     * The metadata returned from an external system
+     * 
+ * + * map<string, string> metadata = 2; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+     * The metadata returned from an external system
+     * 
+ * + * map<string, string> metadata = 2; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+     * The metadata returned from an external system
+     * 
+ * + * map<string, string> metadata = 2; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + 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 (!data_.isEmpty()) { + output.writeBytes(1, data_); + } + com.google.protobuf.GeneratedMessageV3 + .serializeStringMapTo( + output, + internalGetMetadata(), + MetadataDefaultEntryHolder.defaultEntry, + 2); + unknownFields.writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!data_.isEmpty()) { + size += com.google.protobuf.CodedOutputStream + .computeBytesSize(1, data_); + } + for (java.util.Map.Entry entry + : internalGetMetadata().getMap().entrySet()) { + com.google.protobuf.MapEntry + metadata__ = MetadataDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(2, metadata__); + } + size += unknownFields.getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse)) { + return super.equals(obj); + } + spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse other = (spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse) obj; + + if (!getData() + .equals(other.getData())) return false; + if (!internalGetMetadata().equals( + other.internalGetMetadata())) return false; + if (!unknownFields.equals(other.unknownFields)) 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) + DATA_FIELD_NUMBER; + hash = (53 * hash) + getData().hashCode(); + if (!internalGetMetadata().getMap().isEmpty()) { + hash = (37 * hash) + METADATA_FIELD_NUMBER; + hash = (53 * hash) + internalGetMetadata().hashCode(); + } + hash = (29 * hash) + unknownFields.hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse 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 spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse 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 spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse 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(spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse 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; + } + /** + *
+     * InvokeBindingResponse is the message returned from an output binding invocation
+     * 
+ * + * Protobuf type {@code spec.proto.runtime.v1.InvokeBindingResponse} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:spec.proto.runtime.v1.InvokeBindingResponse) + spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponseOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingResponse_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 2: + return internalGetMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 2: + return internalGetMutableMetadata(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingResponse_fieldAccessorTable + .ensureFieldAccessorsInitialized( + spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse.class, spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse.Builder.class); + } + + // Construct using spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + data_ = com.google.protobuf.ByteString.EMPTY; + + internalGetMutableMetadata().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return spec.proto.runtime.v1.RuntimeProto.internal_static_spec_proto_runtime_v1_InvokeBindingResponse_descriptor; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse getDefaultInstanceForType() { + return spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse.getDefaultInstance(); + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse build() { + spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse buildPartial() { + spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse result = new spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse(this); + int from_bitField0_ = bitField0_; + result.data_ = data_; + result.metadata_ = internalGetMetadata(); + result.metadata_.makeImmutable(); + onBuilt(); + return result; + } + + @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 spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse) { + return mergeFrom((spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse other) { + if (other == spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse.getDefaultInstance()) return this; + if (other.getData() != com.google.protobuf.ByteString.EMPTY) { + setData(other.getData()); + } + internalGetMutableMetadata().mergeFrom( + other.internalGetMetadata()); + this.mergeUnknownFields(other.unknownFields); + 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 { + spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse parsedMessage = null; + try { + parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + parsedMessage = (spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse) e.getUnfinishedMessage(); + throw e.unwrapIOException(); + } finally { + if (parsedMessage != null) { + mergeFrom(parsedMessage); + } + } + return this; + } + private int bitField0_; + + private com.google.protobuf.ByteString data_ = com.google.protobuf.ByteString.EMPTY; + /** + *
+       * The data which will be sent to output binding.
+       * 
+ * + * bytes data = 1; + * @return The data. + */ + @java.lang.Override + public com.google.protobuf.ByteString getData() { + return data_; + } + /** + *
+       * The data which will be sent to output binding.
+       * 
+ * + * bytes data = 1; + * @param value The data to set. + * @return This builder for chaining. + */ + public Builder setData(com.google.protobuf.ByteString value) { + if (value == null) { + throw new NullPointerException(); + } + + data_ = value; + onChanged(); + return this; + } + /** + *
+       * The data which will be sent to output binding.
+       * 
+ * + * bytes data = 1; + * @return This builder for chaining. + */ + public Builder clearData() { + + data_ = getDefaultInstance().getData(); + onChanged(); + return this; + } + + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> metadata_; + private com.google.protobuf.MapField + internalGetMetadata() { + if (metadata_ == null) { + return com.google.protobuf.MapField.emptyMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + return metadata_; + } + private com.google.protobuf.MapField + internalGetMutableMetadata() { + onChanged();; + if (metadata_ == null) { + metadata_ = com.google.protobuf.MapField.newMapField( + MetadataDefaultEntryHolder.defaultEntry); + } + if (!metadata_.isMutable()) { + metadata_ = metadata_.copy(); + } + return metadata_; + } + + public int getMetadataCount() { + return internalGetMetadata().getMap().size(); + } + /** + *
+       * The metadata returned from an external system
+       * 
+ * + * map<string, string> metadata = 2; + */ + + @java.lang.Override + public boolean containsMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + return internalGetMetadata().getMap().containsKey(key); + } + /** + * Use {@link #getMetadataMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getMetadata() { + return getMetadataMap(); + } + /** + *
+       * The metadata returned from an external system
+       * 
+ * + * map<string, string> metadata = 2; + */ + @java.lang.Override + + public java.util.Map getMetadataMap() { + return internalGetMetadata().getMap(); + } + /** + *
+       * The metadata returned from an external system
+       * 
+ * + * map<string, string> metadata = 2; + */ + @java.lang.Override + + public java.lang.String getMetadataOrDefault( + java.lang.String key, + java.lang.String defaultValue) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + *
+       * The metadata returned from an external system
+       * 
+ * + * map<string, string> metadata = 2; + */ + @java.lang.Override + + public java.lang.String getMetadataOrThrow( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + java.util.Map map = + internalGetMetadata().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + public Builder clearMetadata() { + internalGetMutableMetadata().getMutableMap() + .clear(); + return this; + } + /** + *
+       * The metadata returned from an external system
+       * 
+ * + * map<string, string> metadata = 2; + */ + + public Builder removeMetadata( + java.lang.String key) { + if (key == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableMetadata() { + return internalGetMutableMetadata().getMutableMap(); + } + /** + *
+       * The metadata returned from an external system
+       * 
+ * + * map<string, string> metadata = 2; + */ + public Builder putMetadata( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new java.lang.NullPointerException(); } + if (value == null) { throw new java.lang.NullPointerException(); } + internalGetMutableMetadata().getMutableMap() + .put(key, value); + return this; + } + /** + *
+       * The metadata returned from an external system
+       * 
+ * + * map<string, string> metadata = 2; + */ + + public Builder putAllMetadata( + java.util.Map values) { + internalGetMutableMetadata().getMutableMap() + .putAll(values); + 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:spec.proto.runtime.v1.InvokeBindingResponse) + } + + // @@protoc_insertion_point(class_scope:spec.proto.runtime.v1.InvokeBindingResponse) + private static final spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse(); + } + + public static spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public InvokeBindingResponse parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return new InvokeBindingResponse(input, extensionRegistry); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public spec.proto.runtime.v1.RuntimeProto.InvokeBindingResponse getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetFileMetaRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetFileMetaRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetFileMetaResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetFileMetaResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_FileMetaValue_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_FileMetaValue_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_FileMeta_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_FileMeta_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_FileMeta_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_FileMeta_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetFileRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetFileRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetFileRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetFileRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetFileResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetFileResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_PutFileRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_PutFileRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_PutFileRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_PutFileRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_FileRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_FileRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_FileRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_FileRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_ListFileRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_ListFileRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_FileInfo_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_FileInfo_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_FileInfo_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_FileInfo_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_ListFileResp_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_ListFileResp_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_DelFileRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_DelFileRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetNextIdRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetNextIdRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetNextIdRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetNextIdRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_SequencerOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_SequencerOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetNextIdResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetNextIdResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_TryLockRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_TryLockRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_TryLockResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_TryLockResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_UnlockRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_UnlockRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_UnlockResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_UnlockResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_SayHelloRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_SayHelloRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_SayHelloResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_SayHelloResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_InvokeServiceRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_InvokeServiceRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_CommonInvokeRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_CommonInvokeRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_HTTPExtension_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_HTTPExtension_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_InvokeResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_InvokeResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_ConfigurationItem_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_ConfigurationItem_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_ConfigurationItem_TagsEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_ConfigurationItem_TagsEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_ConfigurationItem_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_ConfigurationItem_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetConfigurationResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetConfigurationResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_SubscribeConfigurationResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_SubscribeConfigurationResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetStateRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetStateRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetStateRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetStateRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetBulkStateResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetBulkStateResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_BulkStateItem_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_BulkStateItem_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_BulkStateItem_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_BulkStateItem_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetStateResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetStateResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_GetStateResponse_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_GetStateResponse_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_DeleteStateRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_DeleteStateRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_DeleteStateRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_DeleteStateRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_DeleteBulkStateRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_DeleteBulkStateRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_SaveStateRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_SaveStateRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_StateItem_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_StateItem_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_StateItem_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_StateItem_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_Etag_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_Etag_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_StateOptions_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_StateOptions_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_TransactionalStateOperation_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_TransactionalStateOperation_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_PublishEventRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_PublishEventRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_PublishEventRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_PublishEventRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_MetadataEntry_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_fieldAccessorTable; + private static final com.google.protobuf.Descriptors.Descriptor + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_MetadataEntry_descriptor; + private static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_MetadataEntry_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\036proto/runtime/v1/runtime.proto\022\025spec.p" + + "roto.runtime.v1\032\033google/protobuf/empty.p" + + "roto\032\031google/protobuf/any.proto\"I\n\022GetFi" + + "leMetaRequest\0223\n\007request\030\001 \001(\0132\".spec.pr" + + "oto.runtime.v1.FileRequest\"m\n\023GetFileMet" + + "aResponse\022\014\n\004size\030\001 \001(\003\022\025\n\rlast_modified" + + "\030\002 \001(\t\0221\n\010response\030\003 \001(\0132\037.spec.proto.ru" + + "ntime.v1.FileMeta\"\036\n\rFileMetaValue\022\r\n\005va" + + "lue\030\001 \003(\t\"\242\001\n\010FileMeta\022?\n\010metadata\030\001 \003(\013" + + "2-.spec.proto.runtime.v1.FileMeta.Metada" + + "taEntry\032U\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\0223\n" + + "\005value\030\002 \001(\0132$.spec.proto.runtime.v1.Fil" + + "eMetaValue:\0028\001\"\252\001\n\016GetFileRequest\022\022\n\nsto" + + "re_name\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022E\n\010metadata\030" + + "\003 \003(\01323.spec.proto.runtime.v1.GetFileReq" + + "uest.MetadataEntry\032/\n\rMetadataEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\037\n\017GetFileRe" + + "sponse\022\014\n\004data\030\001 \001(\014\"\270\001\n\016PutFileRequest\022" + + "\022\n\nstore_name\030\001 \001(\t\022\014\n\004name\030\002 \001(\t\022\014\n\004dat" + + "a\030\003 \001(\014\022E\n\010metadata\030\004 \003(\01323.spec.proto.r" + + "untime.v1.PutFileRequest.MetadataEntry\032/" + + "\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 " + + "\001(\t:\0028\001\"\244\001\n\013FileRequest\022\022\n\nstore_name\030\001 " + + "\001(\t\022\014\n\004name\030\002 \001(\t\022B\n\010metadata\030\003 \003(\01320.sp" + + "ec.proto.runtime.v1.FileRequest.Metadata" + + "Entry\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005v" + + "alue\030\002 \001(\t:\0028\001\"i\n\017ListFileRequest\0223\n\007req" + + "uest\030\001 \001(\0132\".spec.proto.runtime.v1.FileR" + + "equest\022\021\n\tpage_size\030\002 \001(\005\022\016\n\006marker\030\003 \001(" + + "\t\"\264\001\n\010FileInfo\022\021\n\tfile_name\030\001 \001(\t\022\014\n\004siz" + + "e\030\002 \001(\003\022\025\n\rlast_modified\030\003 \001(\t\022?\n\010metada" + + "ta\030\004 \003(\0132-.spec.proto.runtime.v1.FileInf" + + "o.MetadataEntry\032/\n\rMetadataEntry\022\013\n\003key\030" + + "\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"d\n\014ListFileResp" + + "\022.\n\005files\030\001 \003(\0132\037.spec.proto.runtime.v1." + + "FileInfo\022\016\n\006marker\030\002 \001(\t\022\024\n\014is_truncated" + + "\030\003 \001(\010\"E\n\016DelFileRequest\0223\n\007request\030\001 \001(" + + "\0132\".spec.proto.runtime.v1.FileRequest\"\347\001" + + "\n\020GetNextIdRequest\022\022\n\nstore_name\030\001 \001(\t\022\013" + + "\n\003key\030\002 \001(\t\0228\n\007options\030\003 \001(\0132\'.spec.prot" + + "o.runtime.v1.SequencerOptions\022G\n\010metadat" + + "a\030\004 \003(\01325.spec.proto.runtime.v1.GetNextI" + + "dRequest.MetadataEntry\032/\n\rMetadataEntry\022" + + "\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\203\001\n\020Sequ" + + "encerOptions\022H\n\tincrement\030\001 \001(\01625.spec.p" + + "roto.runtime.v1.SequencerOptions.AutoInc" + + "rement\"%\n\rAutoIncrement\022\010\n\004WEAK\020\000\022\n\n\006STR" + + "ONG\020\001\"(\n\021GetNextIdResponse\022\023\n\007next_id\030\001 " + + "\001(\003B\0020\001\"]\n\016TryLockRequest\022\022\n\nstore_name\030" + + "\001 \001(\t\022\023\n\013resource_id\030\002 \001(\t\022\022\n\nlock_owner" + + "\030\003 \001(\t\022\016\n\006expire\030\004 \001(\005\"\"\n\017TryLockRespons" + + "e\022\017\n\007success\030\001 \001(\010\"L\n\rUnlockRequest\022\022\n\ns" + + "tore_name\030\001 \001(\t\022\023\n\013resource_id\030\002 \001(\t\022\022\n\n" + + "lock_owner\030\003 \001(\t\"\246\001\n\016UnlockResponse\022<\n\006s" + + "tatus\030\001 \001(\0162,.spec.proto.runtime.v1.Unlo" + + "ckResponse.Status\"V\n\006Status\022\013\n\007SUCCESS\020\000" + + "\022\020\n\014LOCK_UNEXIST\020\001\022\031\n\025LOCK_BELONG_TO_OTH" + + "ERS\020\002\022\022\n\016INTERNAL_ERROR\020\003\"Y\n\017SayHelloReq" + + "uest\022\024\n\014service_name\030\001 \001(\t\022\014\n\004name\030\002 \001(\t" + + "\022\"\n\004data\030\003 \001(\0132\024.google.protobuf.Any\"E\n\020" + + "SayHelloResponse\022\r\n\005hello\030\001 \001(\t\022\"\n\004data\030" + + "\002 \001(\0132\024.google.protobuf.Any\"_\n\024InvokeSer" + + "viceRequest\022\n\n\002id\030\001 \001(\t\022;\n\007message\030\003 \001(\013" + + "2*.spec.proto.runtime.v1.CommonInvokeReq" + + "uest\"\235\001\n\023CommonInvokeRequest\022\016\n\006method\030\001" + + " \001(\t\022\"\n\004data\030\002 \001(\0132\024.google.protobuf.Any" + + "\022\024\n\014content_type\030\003 \001(\t\022<\n\016http_extension" + + "\030\004 \001(\0132$.spec.proto.runtime.v1.HTTPExten" + + "sion\"\306\001\n\rHTTPExtension\0227\n\004verb\030\001 \001(\0162).s" + + "pec.proto.runtime.v1.HTTPExtension.Verb\022" + + "\023\n\013querystring\030\002 \001(\t\"g\n\004Verb\022\010\n\004NONE\020\000\022\007" + + "\n\003GET\020\001\022\010\n\004HEAD\020\002\022\010\n\004POST\020\003\022\007\n\003PUT\020\004\022\n\n\006" + + "DELETE\020\005\022\013\n\007CONNECT\020\006\022\013\n\007OPTIONS\020\007\022\t\n\005TR" + + "ACE\020\010\"J\n\016InvokeResponse\022\"\n\004data\030\001 \001(\0132\024." + + "google.protobuf.Any\022\024\n\014content_type\030\002 \001(" + + "\t\"\271\002\n\021ConfigurationItem\022\013\n\003key\030\001 \001(\t\022\017\n\007" + + "content\030\002 \001(\t\022\r\n\005group\030\003 \001(\t\022\r\n\005label\030\004 " + + "\001(\t\022@\n\004tags\030\005 \003(\01322.spec.proto.runtime.v" + + "1.ConfigurationItem.TagsEntry\022H\n\010metadat" + + "a\030\006 \003(\01326.spec.proto.runtime.v1.Configur" + + "ationItem.MetadataEntry\032+\n\tTagsEntry\022\013\n\003" + + "key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\032/\n\rMetadata" + + "Entry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\204\002" + + "\n\027GetConfigurationRequest\022\022\n\nstore_name\030" + + "\001 \001(\t\022\016\n\006app_id\030\002 \001(\t\022\r\n\005group\030\003 \001(\t\022\r\n\005" + + "label\030\004 \001(\t\022\014\n\004keys\030\005 \003(\t\022N\n\010metadata\030\006 " + + "\003(\0132<.spec.proto.runtime.v1.GetConfigura" + + "tionRequest.MetadataEntry\022\030\n\020subscribe_u" + + "pdate\030\007 \001(\010\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\001\"S\n\030GetConfiguration" + + "Response\0227\n\005items\030\001 \003(\0132(.spec.proto.run" + + "time.v1.ConfigurationItem\"\366\001\n\035SubscribeC" + + "onfigurationRequest\022\022\n\nstore_name\030\001 \001(\t\022" + + "\016\n\006app_id\030\002 \001(\t\022\r\n\005group\030\003 \001(\t\022\r\n\005label\030" + + "\004 \001(\t\022\014\n\004keys\030\005 \003(\t\022T\n\010metadata\030\006 \003(\0132B." + + "spec.proto.runtime.v1.SubscribeConfigura" + + "tionRequest.MetadataEntry\032/\n\rMetadataEnt" + + "ry\022\013\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"}\n\036Su" + + "bscribeConfigurationResponse\022\022\n\nstore_na" + + "me\030\001 \001(\t\022\016\n\006app_id\030\002 \001(\t\0227\n\005items\030\003 \003(\0132" + + "(.spec.proto.runtime.v1.ConfigurationIte" + + "m\"\371\001\n\030SaveConfigurationRequest\022\022\n\nstore_" + + "name\030\001 \001(\t\022\016\n\006app_id\030\002 \001(\t\0227\n\005items\030\003 \003(" + + "\0132(.spec.proto.runtime.v1.ConfigurationI" + + "tem\022O\n\010metadata\030\004 \003(\0132=.spec.proto.runti" + + "me.v1.SaveConfigurationRequest.MetadataE" + + "ntry\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001\"\360\001\n\032DeleteConfigurationReq" + + "uest\022\022\n\nstore_name\030\001 \001(\t\022\016\n\006app_id\030\002 \001(\t" + + "\022\r\n\005group\030\003 \001(\t\022\r\n\005label\030\004 \001(\t\022\014\n\004keys\030\005" + + " \003(\t\022Q\n\010metadata\030\006 \003(\0132?.spec.proto.runt" + + "ime.v1.DeleteConfigurationRequest.Metada" + + "taEntry\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n" + + "\005value\030\002 \001(\t:\0028\001\"\366\001\n\017GetStateRequest\022\022\n\n" + + "store_name\030\001 \001(\t\022\013\n\003key\030\002 \001(\t\022I\n\013consist" + + "ency\030\003 \001(\01624.spec.proto.runtime.v1.State" + + "Options.StateConsistency\022F\n\010metadata\030\004 \003" + + "(\01324.spec.proto.runtime.v1.GetStateReque" + + "st.MetadataEntry\032/\n\rMetadataEntry\022\013\n\003key" + + "\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\311\001\n\023GetBulkSta" + + "teRequest\022\022\n\nstore_name\030\001 \001(\t\022\014\n\004keys\030\002 " + + "\003(\t\022\023\n\013parallelism\030\003 \001(\005\022J\n\010metadata\030\004 \003" + + "(\01328.spec.proto.runtime.v1.GetBulkStateR" + + "equest.MetadataEntry\032/\n\rMetadataEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"K\n\024GetBulk" + + "StateResponse\0223\n\005items\030\001 \003(\0132$.spec.prot" + + "o.runtime.v1.BulkStateItem\"\276\001\n\rBulkState" + + "Item\022\013\n\003key\030\001 \001(\t\022\014\n\004data\030\002 \001(\014\022\014\n\004etag\030" + + "\003 \001(\t\022\r\n\005error\030\004 \001(\t\022D\n\010metadata\030\005 \003(\01322" + + ".spec.proto.runtime.v1.BulkStateItem.Met" + + "adataEntry\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t" + + "\022\r\n\005value\030\002 \001(\t:\0028\001\"\250\001\n\020GetStateResponse" + + "\022\014\n\004data\030\001 \001(\014\022\014\n\004etag\030\002 \001(\t\022G\n\010metadata" + + "\030\003 \003(\01325.spec.proto.runtime.v1.GetStateR" + + "esponse.MetadataEntry\032/\n\rMetadataEntry\022\013" + + "\n\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\222\002\n\022Delet" + + "eStateRequest\022\022\n\nstore_name\030\001 \001(\t\022\013\n\003key" + + "\030\002 \001(\t\022)\n\004etag\030\003 \001(\0132\033.spec.proto.runtim" + + "e.v1.Etag\0224\n\007options\030\004 \001(\0132#.spec.proto." + + "runtime.v1.StateOptions\022I\n\010metadata\030\005 \003(" + + "\01327.spec.proto.runtime.v1.DeleteStateReq" + + "uest.MetadataEntry\032/\n\rMetadataEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"^\n\026DeleteBul" + + "kStateRequest\022\022\n\nstore_name\030\001 \001(\t\0220\n\006sta" + + "tes\030\002 \003(\0132 .spec.proto.runtime.v1.StateI" + + "tem\"X\n\020SaveStateRequest\022\022\n\nstore_name\030\001 " + + "\001(\t\0220\n\006states\030\002 \003(\0132 .spec.proto.runtime" + + ".v1.StateItem\"\373\001\n\tStateItem\022\013\n\003key\030\001 \001(\t" + + "\022\r\n\005value\030\002 \001(\014\022)\n\004etag\030\003 \001(\0132\033.spec.pro" + + "to.runtime.v1.Etag\022@\n\010metadata\030\004 \003(\0132..s" + + "pec.proto.runtime.v1.StateItem.MetadataE" + + "ntry\0224\n\007options\030\005 \001(\0132#.spec.proto.runti" + + "me.v1.StateOptions\032/\n\rMetadataEntry\022\013\n\003k" + + "ey\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\025\n\004Etag\022\r\n\005v" + + "alue\030\001 \001(\t\"\361\002\n\014StateOptions\022I\n\013concurren" + + "cy\030\001 \001(\01624.spec.proto.runtime.v1.StateOp" + + "tions.StateConcurrency\022I\n\013consistency\030\002 " + + "\001(\01624.spec.proto.runtime.v1.StateOptions" + + ".StateConsistency\"h\n\020StateConcurrency\022\033\n" + + "\027CONCURRENCY_UNSPECIFIED\020\000\022\033\n\027CONCURRENC" + + "Y_FIRST_WRITE\020\001\022\032\n\026CONCURRENCY_LAST_WRIT" + + "E\020\002\"a\n\020StateConsistency\022\033\n\027CONSISTENCY_U" + + "NSPECIFIED\020\000\022\030\n\024CONSISTENCY_EVENTUAL\020\001\022\026" + + "\n\022CONSISTENCY_STRONG\020\002\"g\n\033TransactionalS" + + "tateOperation\022\025\n\roperationType\030\001 \001(\t\0221\n\007" + + "request\030\002 \001(\0132 .spec.proto.runtime.v1.St" + + "ateItem\"\203\002\n\036ExecuteStateTransactionReque" + + "st\022\021\n\tstoreName\030\001 \001(\t\022F\n\noperations\030\002 \003(" + + "\01322.spec.proto.runtime.v1.TransactionalS" + + "tateOperation\022U\n\010metadata\030\003 \003(\0132C.spec.p" + + "roto.runtime.v1.ExecuteStateTransactionR" + + "equest.MetadataEntry\032/\n\rMetadataEntry\022\013\n" + + "\003key\030\001 \001(\t\022\r\n\005value\030\002 \001(\t:\0028\001\"\337\001\n\023Publis" + + "hEventRequest\022\023\n\013pubsub_name\030\001 \001(\t\022\r\n\005to" + + "pic\030\002 \001(\t\022\014\n\004data\030\003 \001(\014\022\031\n\021data_content_" + + "type\030\004 \001(\t\022J\n\010metadata\030\005 \003(\01328.spec.prot" + + "o.runtime.v1.PublishEventRequest.Metadat" + + "aEntry\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005" + + "value\030\002 \001(\t:\0028\001\"\303\001\n\024InvokeBindingRequest" + + "\022\014\n\004name\030\001 \001(\t\022\014\n\004data\030\002 \001(\014\022K\n\010metadata" + + "\030\003 \003(\01329.spec.proto.runtime.v1.InvokeBin" + + "dingRequest.MetadataEntry\022\021\n\toperation\030\004" + + " \001(\t\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(\t\022\r\n\005va" + + "lue\030\002 \001(\t:\0028\001\"\244\001\n\025InvokeBindingResponse\022" + + "\014\n\004data\030\001 \001(\014\022L\n\010metadata\030\002 \003(\0132:.spec.p" + + "roto.runtime.v1.InvokeBindingResponse.Me" + + "tadataEntry\032/\n\rMetadataEntry\022\013\n\003key\030\001 \001(" + + "\t\022\r\n\005value\030\002 \001(\t:\0028\0012\344\020\n\007Runtime\022]\n\010SayH" + + "ello\022&.spec.proto.runtime.v1.SayHelloReq" + + "uest\032\'.spec.proto.runtime.v1.SayHelloRes" + + "ponse\"\000\022e\n\rInvokeService\022+.spec.proto.ru" + + "ntime.v1.InvokeServiceRequest\032%.spec.pro" + + "to.runtime.v1.InvokeResponse\"\000\022u\n\020GetCon" + + "figuration\022..spec.proto.runtime.v1.GetCo" + + "nfigurationRequest\032/.spec.proto.runtime." + + "v1.GetConfigurationResponse\"\000\022^\n\021SaveCon" + + "figuration\022/.spec.proto.runtime.v1.SaveC" + + "onfigurationRequest\032\026.google.protobuf.Em" + + "pty\"\000\022b\n\023DeleteConfiguration\0221.spec.prot" + + "o.runtime.v1.DeleteConfigurationRequest\032" + + "\026.google.protobuf.Empty\"\000\022\213\001\n\026SubscribeC" + + "onfiguration\0224.spec.proto.runtime.v1.Sub" + + "scribeConfigurationRequest\0325.spec.proto." + + "runtime.v1.SubscribeConfigurationRespons" + + "e\"\000(\0010\001\022Z\n\007TryLock\022%.spec.proto.runtime." + + "v1.TryLockRequest\032&.spec.proto.runtime.v" + + "1.TryLockResponse\"\000\022W\n\006Unlock\022$.spec.pro" + + "to.runtime.v1.UnlockRequest\032%.spec.proto" + + ".runtime.v1.UnlockResponse\"\000\022`\n\tGetNextI" + + "d\022\'.spec.proto.runtime.v1.GetNextIdReque" + + "st\032(.spec.proto.runtime.v1.GetNextIdResp" + + "onse\"\000\022]\n\010GetState\022&.spec.proto.runtime." + + "v1.GetStateRequest\032\'.spec.proto.runtime." + + "v1.GetStateResponse\"\000\022i\n\014GetBulkState\022*." + + "spec.proto.runtime.v1.GetBulkStateReques" + + "t\032+.spec.proto.runtime.v1.GetBulkStateRe" + + "sponse\"\000\022N\n\tSaveState\022\'.spec.proto.runti" + + "me.v1.SaveStateRequest\032\026.google.protobuf" + + ".Empty\"\000\022R\n\013DeleteState\022).spec.proto.run" + + "time.v1.DeleteStateRequest\032\026.google.prot" + + "obuf.Empty\"\000\022Z\n\017DeleteBulkState\022-.spec.p" + + "roto.runtime.v1.DeleteBulkStateRequest\032\026" + + ".google.protobuf.Empty\"\000\022j\n\027ExecuteState" + + "Transaction\0225.spec.proto.runtime.v1.Exec" + + "uteStateTransactionRequest\032\026.google.prot" + + "obuf.Empty\"\000\022T\n\014PublishEvent\022*.spec.prot" + + "o.runtime.v1.PublishEventRequest\032\026.googl" + + "e.protobuf.Empty\"\000\022\\\n\007GetFile\022%.spec.pro" + + "to.runtime.v1.GetFileRequest\032&.spec.prot" + + "o.runtime.v1.GetFileResponse\"\0000\001\022L\n\007PutF" + + "ile\022%.spec.proto.runtime.v1.PutFileReque" + + "st\032\026.google.protobuf.Empty\"\000(\001\022Y\n\010ListFi" + + "le\022&.spec.proto.runtime.v1.ListFileReque" + + "st\032#.spec.proto.runtime.v1.ListFileResp\"" + + "\000\022J\n\007DelFile\022%.spec.proto.runtime.v1.Del" + + "FileRequest\032\026.google.protobuf.Empty\"\000\022f\n" + + "\013GetFileMeta\022).spec.proto.runtime.v1.Get" + + "FileMetaRequest\032*.spec.proto.runtime.v1." + + "GetFileMetaResponse\"\000\022l\n\rInvokeBinding\022+" + + ".spec.proto.runtime.v1.InvokeBindingRequ" + + "est\032,.spec.proto.runtime.v1.InvokeBindin" + + "gResponse\"\000BT\n\025spec.proto.runtime.v1B\014Ru" + + "ntimeProtoZ-mosn.io/layotto/spec/proto/r" + + "untime/v1;runtimeb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + com.google.protobuf.EmptyProto.getDescriptor(), + com.google.protobuf.AnyProto.getDescriptor(), + }); + internal_static_spec_proto_runtime_v1_GetFileMetaRequest_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_spec_proto_runtime_v1_GetFileMetaRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetFileMetaRequest_descriptor, + new java.lang.String[] { "Request", }); + internal_static_spec_proto_runtime_v1_GetFileMetaResponse_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_spec_proto_runtime_v1_GetFileMetaResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetFileMetaResponse_descriptor, + new java.lang.String[] { "Size", "LastModified", "Response", }); + internal_static_spec_proto_runtime_v1_FileMetaValue_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_spec_proto_runtime_v1_FileMetaValue_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_FileMetaValue_descriptor, + new java.lang.String[] { "Value", }); + internal_static_spec_proto_runtime_v1_FileMeta_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_spec_proto_runtime_v1_FileMeta_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_FileMeta_descriptor, + new java.lang.String[] { "Metadata", }); + internal_static_spec_proto_runtime_v1_FileMeta_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_FileMeta_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_FileMeta_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_FileMeta_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_GetFileRequest_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_spec_proto_runtime_v1_GetFileRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetFileRequest_descriptor, + new java.lang.String[] { "StoreName", "Name", "Metadata", }); + internal_static_spec_proto_runtime_v1_GetFileRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_GetFileRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_GetFileRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetFileRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_GetFileResponse_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_spec_proto_runtime_v1_GetFileResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetFileResponse_descriptor, + new java.lang.String[] { "Data", }); + internal_static_spec_proto_runtime_v1_PutFileRequest_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_spec_proto_runtime_v1_PutFileRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_PutFileRequest_descriptor, + new java.lang.String[] { "StoreName", "Name", "Data", "Metadata", }); + internal_static_spec_proto_runtime_v1_PutFileRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_PutFileRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_PutFileRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_PutFileRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_FileRequest_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_spec_proto_runtime_v1_FileRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_FileRequest_descriptor, + new java.lang.String[] { "StoreName", "Name", "Metadata", }); + internal_static_spec_proto_runtime_v1_FileRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_FileRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_FileRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_FileRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_ListFileRequest_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_spec_proto_runtime_v1_ListFileRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_ListFileRequest_descriptor, + new java.lang.String[] { "Request", "PageSize", "Marker", }); + internal_static_spec_proto_runtime_v1_FileInfo_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_spec_proto_runtime_v1_FileInfo_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_FileInfo_descriptor, + new java.lang.String[] { "FileName", "Size", "LastModified", "Metadata", }); + internal_static_spec_proto_runtime_v1_FileInfo_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_FileInfo_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_FileInfo_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_FileInfo_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_ListFileResp_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_spec_proto_runtime_v1_ListFileResp_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_ListFileResp_descriptor, + new java.lang.String[] { "Files", "Marker", "IsTruncated", }); + internal_static_spec_proto_runtime_v1_DelFileRequest_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_spec_proto_runtime_v1_DelFileRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_DelFileRequest_descriptor, + new java.lang.String[] { "Request", }); + internal_static_spec_proto_runtime_v1_GetNextIdRequest_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_spec_proto_runtime_v1_GetNextIdRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetNextIdRequest_descriptor, + new java.lang.String[] { "StoreName", "Key", "Options", "Metadata", }); + internal_static_spec_proto_runtime_v1_GetNextIdRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_GetNextIdRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_GetNextIdRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetNextIdRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_SequencerOptions_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_spec_proto_runtime_v1_SequencerOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_SequencerOptions_descriptor, + new java.lang.String[] { "Increment", }); + internal_static_spec_proto_runtime_v1_GetNextIdResponse_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_spec_proto_runtime_v1_GetNextIdResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetNextIdResponse_descriptor, + new java.lang.String[] { "NextId", }); + internal_static_spec_proto_runtime_v1_TryLockRequest_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_spec_proto_runtime_v1_TryLockRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_TryLockRequest_descriptor, + new java.lang.String[] { "StoreName", "ResourceId", "LockOwner", "Expire", }); + internal_static_spec_proto_runtime_v1_TryLockResponse_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_spec_proto_runtime_v1_TryLockResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_TryLockResponse_descriptor, + new java.lang.String[] { "Success", }); + internal_static_spec_proto_runtime_v1_UnlockRequest_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_spec_proto_runtime_v1_UnlockRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_UnlockRequest_descriptor, + new java.lang.String[] { "StoreName", "ResourceId", "LockOwner", }); + internal_static_spec_proto_runtime_v1_UnlockResponse_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_spec_proto_runtime_v1_UnlockResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_UnlockResponse_descriptor, + new java.lang.String[] { "Status", }); + internal_static_spec_proto_runtime_v1_SayHelloRequest_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_spec_proto_runtime_v1_SayHelloRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_SayHelloRequest_descriptor, + new java.lang.String[] { "ServiceName", "Name", "Data", }); + internal_static_spec_proto_runtime_v1_SayHelloResponse_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_spec_proto_runtime_v1_SayHelloResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_SayHelloResponse_descriptor, + new java.lang.String[] { "Hello", "Data", }); + internal_static_spec_proto_runtime_v1_InvokeServiceRequest_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_spec_proto_runtime_v1_InvokeServiceRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_InvokeServiceRequest_descriptor, + new java.lang.String[] { "Id", "Message", }); + internal_static_spec_proto_runtime_v1_CommonInvokeRequest_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_spec_proto_runtime_v1_CommonInvokeRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_CommonInvokeRequest_descriptor, + new java.lang.String[] { "Method", "Data", "ContentType", "HttpExtension", }); + internal_static_spec_proto_runtime_v1_HTTPExtension_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_spec_proto_runtime_v1_HTTPExtension_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_HTTPExtension_descriptor, + new java.lang.String[] { "Verb", "Querystring", }); + internal_static_spec_proto_runtime_v1_InvokeResponse_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_spec_proto_runtime_v1_InvokeResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_InvokeResponse_descriptor, + new java.lang.String[] { "Data", "ContentType", }); + internal_static_spec_proto_runtime_v1_ConfigurationItem_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_spec_proto_runtime_v1_ConfigurationItem_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_ConfigurationItem_descriptor, + new java.lang.String[] { "Key", "Content", "Group", "Label", "Tags", "Metadata", }); + internal_static_spec_proto_runtime_v1_ConfigurationItem_TagsEntry_descriptor = + internal_static_spec_proto_runtime_v1_ConfigurationItem_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_ConfigurationItem_TagsEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_ConfigurationItem_TagsEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_ConfigurationItem_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_ConfigurationItem_descriptor.getNestedTypes().get(1); + internal_static_spec_proto_runtime_v1_ConfigurationItem_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_ConfigurationItem_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_descriptor, + new java.lang.String[] { "StoreName", "AppId", "Group", "Label", "Keys", "Metadata", "SubscribeUpdate", }); + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetConfigurationRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_GetConfigurationResponse_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_spec_proto_runtime_v1_GetConfigurationResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetConfigurationResponse_descriptor, + new java.lang.String[] { "Items", }); + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_descriptor, + new java.lang.String[] { "StoreName", "AppId", "Group", "Label", "Keys", "Metadata", }); + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_SubscribeConfigurationRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_SubscribeConfigurationResponse_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_spec_proto_runtime_v1_SubscribeConfigurationResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_SubscribeConfigurationResponse_descriptor, + new java.lang.String[] { "StoreName", "AppId", "Items", }); + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_descriptor, + new java.lang.String[] { "StoreName", "AppId", "Items", "Metadata", }); + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_SaveConfigurationRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_descriptor, + new java.lang.String[] { "StoreName", "AppId", "Group", "Label", "Keys", "Metadata", }); + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_DeleteConfigurationRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_GetStateRequest_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_spec_proto_runtime_v1_GetStateRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetStateRequest_descriptor, + new java.lang.String[] { "StoreName", "Key", "Consistency", "Metadata", }); + internal_static_spec_proto_runtime_v1_GetStateRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_GetStateRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_GetStateRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetStateRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_descriptor, + new java.lang.String[] { "StoreName", "Keys", "Parallelism", "Metadata", }); + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetBulkStateRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_GetBulkStateResponse_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_spec_proto_runtime_v1_GetBulkStateResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetBulkStateResponse_descriptor, + new java.lang.String[] { "Items", }); + internal_static_spec_proto_runtime_v1_BulkStateItem_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_spec_proto_runtime_v1_BulkStateItem_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_BulkStateItem_descriptor, + new java.lang.String[] { "Key", "Data", "Etag", "Error", "Metadata", }); + internal_static_spec_proto_runtime_v1_BulkStateItem_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_BulkStateItem_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_BulkStateItem_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_BulkStateItem_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_GetStateResponse_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_spec_proto_runtime_v1_GetStateResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetStateResponse_descriptor, + new java.lang.String[] { "Data", "Etag", "Metadata", }); + internal_static_spec_proto_runtime_v1_GetStateResponse_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_GetStateResponse_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_GetStateResponse_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_GetStateResponse_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_DeleteStateRequest_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_spec_proto_runtime_v1_DeleteStateRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_DeleteStateRequest_descriptor, + new java.lang.String[] { "StoreName", "Key", "Etag", "Options", "Metadata", }); + internal_static_spec_proto_runtime_v1_DeleteStateRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_DeleteStateRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_DeleteStateRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_DeleteStateRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_DeleteBulkStateRequest_descriptor = + getDescriptor().getMessageTypes().get(38); + internal_static_spec_proto_runtime_v1_DeleteBulkStateRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_DeleteBulkStateRequest_descriptor, + new java.lang.String[] { "StoreName", "States", }); + internal_static_spec_proto_runtime_v1_SaveStateRequest_descriptor = + getDescriptor().getMessageTypes().get(39); + internal_static_spec_proto_runtime_v1_SaveStateRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_SaveStateRequest_descriptor, + new java.lang.String[] { "StoreName", "States", }); + internal_static_spec_proto_runtime_v1_StateItem_descriptor = + getDescriptor().getMessageTypes().get(40); + internal_static_spec_proto_runtime_v1_StateItem_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_StateItem_descriptor, + new java.lang.String[] { "Key", "Value", "Etag", "Metadata", "Options", }); + internal_static_spec_proto_runtime_v1_StateItem_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_StateItem_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_StateItem_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_StateItem_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_Etag_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_spec_proto_runtime_v1_Etag_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_Etag_descriptor, + new java.lang.String[] { "Value", }); + internal_static_spec_proto_runtime_v1_StateOptions_descriptor = + getDescriptor().getMessageTypes().get(42); + internal_static_spec_proto_runtime_v1_StateOptions_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_StateOptions_descriptor, + new java.lang.String[] { "Concurrency", "Consistency", }); + internal_static_spec_proto_runtime_v1_TransactionalStateOperation_descriptor = + getDescriptor().getMessageTypes().get(43); + internal_static_spec_proto_runtime_v1_TransactionalStateOperation_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_TransactionalStateOperation_descriptor, + new java.lang.String[] { "OperationType", "Request", }); + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_descriptor = + getDescriptor().getMessageTypes().get(44); + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_descriptor, + new java.lang.String[] { "StoreName", "Operations", "Metadata", }); + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_ExecuteStateTransactionRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_PublishEventRequest_descriptor = + getDescriptor().getMessageTypes().get(45); + internal_static_spec_proto_runtime_v1_PublishEventRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_PublishEventRequest_descriptor, + new java.lang.String[] { "PubsubName", "Topic", "Data", "DataContentType", "Metadata", }); + internal_static_spec_proto_runtime_v1_PublishEventRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_PublishEventRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_PublishEventRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_PublishEventRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_descriptor = + getDescriptor().getMessageTypes().get(46); + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_descriptor, + new java.lang.String[] { "Name", "Data", "Metadata", "Operation", }); + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_InvokeBindingRequest_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_descriptor = + getDescriptor().getMessageTypes().get(47); + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_descriptor, + new java.lang.String[] { "Data", "Metadata", }); + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_MetadataEntry_descriptor = + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_descriptor.getNestedTypes().get(0); + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_MetadataEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_spec_proto_runtime_v1_InvokeBindingResponse_MetadataEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + com.google.protobuf.EmptyProto.getDescriptor(); + com.google.protobuf.AnyProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/tools/codestyle/HEADER b/tools/codestyle/HEADER new file mode 100644 index 0000000..19049e1 --- /dev/null +++ b/tools/codestyle/HEADER @@ -0,0 +1,13 @@ +Copyright 2021 Layotto Authors +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. + diff --git a/tools/codestyle/formatter.xml b/tools/codestyle/formatter.xml new file mode 100644 index 0000000..e9db5f3 --- /dev/null +++ b/tools/codestyle/formatter.xml @@ -0,0 +1,279 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file